1. Packages
  2. AWS Classic
  3. API Docs
  4. cloudfront
  5. getOriginAccessIdentities

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.cloudfront.getOriginAccessIdentities

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Use this data source to get ARNs, ids and S3 canonical user IDs of Amazon CloudFront origin access identities.

    Example Usage

    All origin access identities in the account

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.cloudfront.getOriginAccessIdentities({});
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.cloudfront.get_origin_access_identities()
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudfront.GetOriginAccessIdentities(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.CloudFront.GetOriginAccessIdentities.Invoke();
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudfront.CloudfrontFunctions;
    import com.pulumi.aws.cloudfront.inputs.GetOriginAccessIdentitiesArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = CloudfrontFunctions.getOriginAccessIdentities();
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:cloudfront:getOriginAccessIdentities
          Arguments: {}
    

    Origin access identities filtered by comment/name

    Origin access identities whose comments are example-comment1, example-comment2

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.cloudfront.getOriginAccessIdentities({
        comments: [
            "example-comment1",
            "example-comment2",
        ],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.cloudfront.get_origin_access_identities(comments=[
        "example-comment1",
        "example-comment2",
    ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudfront.GetOriginAccessIdentities(ctx, &cloudfront.GetOriginAccessIdentitiesArgs{
    			Comments: []string{
    				"example-comment1",
    				"example-comment2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.CloudFront.GetOriginAccessIdentities.Invoke(new()
        {
            Comments = new[]
            {
                "example-comment1",
                "example-comment2",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudfront.CloudfrontFunctions;
    import com.pulumi.aws.cloudfront.inputs.GetOriginAccessIdentitiesArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = CloudfrontFunctions.getOriginAccessIdentities(GetOriginAccessIdentitiesArgs.builder()
                .comments(            
                    "example-comment1",
                    "example-comment2")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:cloudfront:getOriginAccessIdentities
          Arguments:
            comments:
              - example-comment1
              - example-comment2
    

    Using getOriginAccessIdentities

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getOriginAccessIdentities(args: GetOriginAccessIdentitiesArgs, opts?: InvokeOptions): Promise<GetOriginAccessIdentitiesResult>
    function getOriginAccessIdentitiesOutput(args: GetOriginAccessIdentitiesOutputArgs, opts?: InvokeOptions): Output<GetOriginAccessIdentitiesResult>
    def get_origin_access_identities(comments: Optional[Sequence[str]] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetOriginAccessIdentitiesResult
    def get_origin_access_identities_output(comments: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                     opts: Optional[InvokeOptions] = None) -> Output[GetOriginAccessIdentitiesResult]
    func GetOriginAccessIdentities(ctx *Context, args *GetOriginAccessIdentitiesArgs, opts ...InvokeOption) (*GetOriginAccessIdentitiesResult, error)
    func GetOriginAccessIdentitiesOutput(ctx *Context, args *GetOriginAccessIdentitiesOutputArgs, opts ...InvokeOption) GetOriginAccessIdentitiesResultOutput

    > Note: This function is named GetOriginAccessIdentities in the Go SDK.

    public static class GetOriginAccessIdentities 
    {
        public static Task<GetOriginAccessIdentitiesResult> InvokeAsync(GetOriginAccessIdentitiesArgs args, InvokeOptions? opts = null)
        public static Output<GetOriginAccessIdentitiesResult> Invoke(GetOriginAccessIdentitiesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetOriginAccessIdentitiesResult> getOriginAccessIdentities(GetOriginAccessIdentitiesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:cloudfront/getOriginAccessIdentities:getOriginAccessIdentities
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Comments List<string>
    Filter origin access identities by comment.
    Comments []string
    Filter origin access identities by comment.
    comments List<String>
    Filter origin access identities by comment.
    comments string[]
    Filter origin access identities by comment.
    comments Sequence[str]
    Filter origin access identities by comment.
    comments List<String>
    Filter origin access identities by comment.

    getOriginAccessIdentities Result

    The following output properties are available:

    IamArns List<string>
    Set of ARNs of the matched origin access identities.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Set of ids of the matched origin access identities.
    S3CanonicalUserIds List<string>
    Set of S3 canonical user IDs of the matched origin access identities.
    Comments List<string>
    IamArns []string
    Set of ARNs of the matched origin access identities.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Set of ids of the matched origin access identities.
    S3CanonicalUserIds []string
    Set of S3 canonical user IDs of the matched origin access identities.
    Comments []string
    iamArns List<String>
    Set of ARNs of the matched origin access identities.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    Set of ids of the matched origin access identities.
    s3CanonicalUserIds List<String>
    Set of S3 canonical user IDs of the matched origin access identities.
    comments List<String>
    iamArns string[]
    Set of ARNs of the matched origin access identities.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    Set of ids of the matched origin access identities.
    s3CanonicalUserIds string[]
    Set of S3 canonical user IDs of the matched origin access identities.
    comments string[]
    iam_arns Sequence[str]
    Set of ARNs of the matched origin access identities.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    Set of ids of the matched origin access identities.
    s3_canonical_user_ids Sequence[str]
    Set of S3 canonical user IDs of the matched origin access identities.
    comments Sequence[str]
    iamArns List<String>
    Set of ARNs of the matched origin access identities.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    Set of ids of the matched origin access identities.
    s3CanonicalUserIds List<String>
    Set of S3 canonical user IDs of the matched origin access identities.
    comments List<String>

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi