aws logo
AWS Classic v5.29.0, Feb 1 23

aws.cloudfront.OriginAccessIdentity

Creates an Amazon CloudFront origin access identity.

For information about CloudFront distributions, see the Amazon CloudFront Developer Guide. For more information on generating origin access identities, see Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content.

Using With CloudFront

Normally, when referencing an origin access identity in CloudFront, you need to prefix the ID with the origin-access-identity/cloudfront/ special path. The cloudfront_access_identity_path allows this to be circumvented. The below snippet demonstrates use with the s3_origin_config structure for the aws.cloudfront.Distribution resource:

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// ... other configuration ...
const example = new aws.cloudfront.Distribution("example", {origins: [{
    s3OriginConfig: {
        originAccessIdentity: aws_cloudfront_origin_access_identity.example.cloudfront_access_identity_path,
    },
}]});
import pulumi
import pulumi_aws as aws

# ... other configuration ...
example = aws.cloudfront.Distribution("example", origins=[aws.cloudfront.DistributionOriginArgs(
    s3_origin_config=aws.cloudfront.DistributionOriginS3OriginConfigArgs(
        origin_access_identity=aws_cloudfront_origin_access_identity["example"]["cloudfront_access_identity_path"],
    ),
)])
using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    // ... other configuration ...
    var example = new Aws.CloudFront.Distribution("example", new()
    {
        Origins = new[]
        {
            new Aws.CloudFront.Inputs.DistributionOriginArgs
            {
                S3OriginConfig = new Aws.CloudFront.Inputs.DistributionOriginS3OriginConfigArgs
                {
                    OriginAccessIdentity = aws_cloudfront_origin_access_identity.Example.Cloudfront_access_identity_path,
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/cloudfront"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudfront.NewDistribution(ctx, "example", &cloudfront.DistributionArgs{
			Origins: cloudfront.DistributionOriginArray{
				&cloudfront.DistributionOriginArgs{
					S3OriginConfig: &cloudfront.DistributionOriginS3OriginConfigArgs{
						OriginAccessIdentity: pulumi.Any(aws_cloudfront_origin_access_identity.Example.Cloudfront_access_identity_path),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudfront.Distribution;
import com.pulumi.aws.cloudfront.DistributionArgs;
import com.pulumi.aws.cloudfront.inputs.DistributionOriginArgs;
import com.pulumi.aws.cloudfront.inputs.DistributionOriginS3OriginConfigArgs;
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) {
        var example = new Distribution("example", DistributionArgs.builder()        
            .origins(DistributionOriginArgs.builder()
                .s3OriginConfig(DistributionOriginS3OriginConfigArgs.builder()
                    .originAccessIdentity(aws_cloudfront_origin_access_identity.example().cloudfront_access_identity_path())
                    .build())
                .build())
            .build());

    }
}
resources:
  example:
    type: aws:cloudfront:Distribution
    properties:
      origins:
        - s3OriginConfig:
            originAccessIdentity: ${aws_cloudfront_origin_access_identity.example.cloudfront_access_identity_path}

Updating your bucket policy

Note that the AWS API may translate the s3_canonical_user_id CanonicalUser principal into an AWS IAM ARN principal when supplied in an aws.s3.BucketV2 bucket policy, causing spurious diffs. If you see this behaviour, use the iam_arn instead:

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const s3Policy = aws.iam.getPolicyDocument({
    statements: [{
        actions: ["s3:GetObject"],
        resources: [`${aws_s3_bucket.example.arn}/*`],
        principals: [{
            type: "AWS",
            identifiers: [aws_cloudfront_origin_access_identity.example.iam_arn],
        }],
    }],
});
const example = new aws.s3.BucketPolicy("example", {
    bucket: aws_s3_bucket.example.id,
    policy: s3Policy.then(s3Policy => s3Policy.json),
});
import pulumi
import pulumi_aws as aws

s3_policy = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs(
    actions=["s3:GetObject"],
    resources=[f"{aws_s3_bucket['example']['arn']}/*"],
    principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
        type="AWS",
        identifiers=[aws_cloudfront_origin_access_identity["example"]["iam_arn"]],
    )],
)])
example = aws.s3.BucketPolicy("example",
    bucket=aws_s3_bucket["example"]["id"],
    policy=s3_policy.json)
using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var s3Policy = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
            {
                Actions = new[]
                {
                    "s3:GetObject",
                },
                Resources = new[]
                {
                    $"{aws_s3_bucket.Example.Arn}/*",
                },
                Principals = new[]
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
                    {
                        Type = "AWS",
                        Identifiers = new[]
                        {
                            aws_cloudfront_origin_access_identity.Example.Iam_arn,
                        },
                    },
                },
            },
        },
    });

    var example = new Aws.S3.BucketPolicy("example", new()
    {
        Bucket = aws_s3_bucket.Example.Id,
        Policy = s3Policy.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.s3.BucketPolicy;
import com.pulumi.aws.s3.BucketPolicyArgs;
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 s3Policy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .actions("s3:GetObject")
                .resources(String.format("%s/*", aws_s3_bucket.example().arn()))
                .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                    .type("AWS")
                    .identifiers(aws_cloudfront_origin_access_identity.example().iam_arn())
                    .build())
                .build())
            .build());

        var example = new BucketPolicy("example", BucketPolicyArgs.builder()        
            .bucket(aws_s3_bucket.example().id())
            .policy(s3Policy.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
            .build());

    }
}
resources:
  example:
    type: aws:s3:BucketPolicy
    properties:
      bucket: ${aws_s3_bucket.example.id}
      policy: ${s3Policy.json}
variables:
  s3Policy:
    fn::invoke:
      Function: aws:iam:getPolicyDocument
      Arguments:
        statements:
          - actions:
              - s3:GetObject
            resources:
              - ${aws_s3_bucket.example.arn}/*
            principals:
              - type: AWS
                identifiers:
                  - ${aws_cloudfront_origin_access_identity.example.iam_arn}

Example Usage

The following example below creates a CloudFront origin access identity.

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.CloudFront.OriginAccessIdentity("example", new()
    {
        Comment = "Some comment",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/cloudfront"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudfront.NewOriginAccessIdentity(ctx, "example", &cloudfront.OriginAccessIdentityArgs{
			Comment: pulumi.String("Some comment"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudfront.OriginAccessIdentity;
import com.pulumi.aws.cloudfront.OriginAccessIdentityArgs;
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) {
        var example = new OriginAccessIdentity("example", OriginAccessIdentityArgs.builder()        
            .comment("Some comment")
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.cloudfront.OriginAccessIdentity("example", comment="Some comment")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.cloudfront.OriginAccessIdentity("example", {comment: "Some comment"});
resources:
  example:
    type: aws:cloudfront:OriginAccessIdentity
    properties:
      comment: Some comment

resource

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    // ... other configuration ...
    var example = new Aws.CloudFront.Distribution("example", new()
    {
        Origins = new[]
        {
            new Aws.CloudFront.Inputs.DistributionOriginArgs
            {
                S3OriginConfig = new Aws.CloudFront.Inputs.DistributionOriginS3OriginConfigArgs
                {
                    OriginAccessIdentity = aws_cloudfront_origin_access_identity.Example.Cloudfront_access_identity_path,
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/cloudfront"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudfront.NewDistribution(ctx, "example", &cloudfront.DistributionArgs{
			Origins: cloudfront.DistributionOriginArray{
				&cloudfront.DistributionOriginArgs{
					S3OriginConfig: &cloudfront.DistributionOriginS3OriginConfigArgs{
						OriginAccessIdentity: pulumi.Any(aws_cloudfront_origin_access_identity.Example.Cloudfront_access_identity_path),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudfront.Distribution;
import com.pulumi.aws.cloudfront.DistributionArgs;
import com.pulumi.aws.cloudfront.inputs.DistributionOriginArgs;
import com.pulumi.aws.cloudfront.inputs.DistributionOriginS3OriginConfigArgs;
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) {
        var example = new Distribution("example", DistributionArgs.builder()        
            .origins(DistributionOriginArgs.builder()
                .s3OriginConfig(DistributionOriginS3OriginConfigArgs.builder()
                    .originAccessIdentity(aws_cloudfront_origin_access_identity.example().cloudfront_access_identity_path())
                    .build())
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

# ... other configuration ...
example = aws.cloudfront.Distribution("example", origins=[aws.cloudfront.DistributionOriginArgs(
    s3_origin_config=aws.cloudfront.DistributionOriginS3OriginConfigArgs(
        origin_access_identity=aws_cloudfront_origin_access_identity["example"]["cloudfront_access_identity_path"],
    ),
)])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// ... other configuration ...
const example = new aws.cloudfront.Distribution("example", {origins: [{
    s3OriginConfig: {
        originAccessIdentity: aws_cloudfront_origin_access_identity.example.cloudfront_access_identity_path,
    },
}]});
resources:
  example:
    type: aws:cloudfront:Distribution
    properties:
      origins:
        - s3OriginConfig:
            originAccessIdentity: ${aws_cloudfront_origin_access_identity.example.cloudfront_access_identity_path}

Updating your bucket policy

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var s3Policy = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
            {
                Actions = new[]
                {
                    "s3:GetObject",
                },
                Resources = new[]
                {
                    $"{aws_s3_bucket.Example.Arn}/*",
                },
                Principals = new[]
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
                    {
                        Type = "AWS",
                        Identifiers = new[]
                        {
                            aws_cloudfront_origin_access_identity.Example.Iam_arn,
                        },
                    },
                },
            },
        },
    });

    var example = new Aws.S3.BucketPolicy("example", new()
    {
        Bucket = aws_s3_bucket.Example.Id,
        Policy = s3Policy.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
    });

});

Coming soon!

package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.s3.BucketPolicy;
import com.pulumi.aws.s3.BucketPolicyArgs;
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 s3Policy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .actions("s3:GetObject")
                .resources(String.format("%s/*", aws_s3_bucket.example().arn()))
                .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                    .type("AWS")
                    .identifiers(aws_cloudfront_origin_access_identity.example().iam_arn())
                    .build())
                .build())
            .build());

        var example = new BucketPolicy("example", BucketPolicyArgs.builder()        
            .bucket(aws_s3_bucket.example().id())
            .policy(s3Policy.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
            .build());

    }
}
import pulumi
import pulumi_aws as aws

s3_policy = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs(
    actions=["s3:GetObject"],
    resources=[f"{aws_s3_bucket['example']['arn']}/*"],
    principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
        type="AWS",
        identifiers=[aws_cloudfront_origin_access_identity["example"]["iam_arn"]],
    )],
)])
example = aws.s3.BucketPolicy("example",
    bucket=aws_s3_bucket["example"]["id"],
    policy=s3_policy.json)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const s3Policy = aws.iam.getPolicyDocument({
    statements: [{
        actions: ["s3:GetObject"],
        resources: [`${aws_s3_bucket.example.arn}/*`],
        principals: [{
            type: "AWS",
            identifiers: [aws_cloudfront_origin_access_identity.example.iam_arn],
        }],
    }],
});
const example = new aws.s3.BucketPolicy("example", {
    bucket: aws_s3_bucket.example.id,
    policy: s3Policy.then(s3Policy => s3Policy.json),
});
resources:
  example:
    type: aws:s3:BucketPolicy
    properties:
      bucket: ${aws_s3_bucket.example.id}
      policy: ${s3Policy.json}
variables:
  s3Policy:
    fn::invoke:
      Function: aws:iam:getPolicyDocument
      Arguments:
        statements:
          - actions:
              - s3:GetObject
            resources:
              - ${aws_s3_bucket.example.arn}/*
            principals:
              - type: AWS
                identifiers:
                  - ${aws_cloudfront_origin_access_identity.example.iam_arn}

Create OriginAccessIdentity Resource

new OriginAccessIdentity(name: string, args?: OriginAccessIdentityArgs, opts?: CustomResourceOptions);
@overload
def OriginAccessIdentity(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         comment: Optional[str] = None)
@overload
def OriginAccessIdentity(resource_name: str,
                         args: Optional[OriginAccessIdentityArgs] = None,
                         opts: Optional[ResourceOptions] = None)
func NewOriginAccessIdentity(ctx *Context, name string, args *OriginAccessIdentityArgs, opts ...ResourceOption) (*OriginAccessIdentity, error)
public OriginAccessIdentity(string name, OriginAccessIdentityArgs? args = null, CustomResourceOptions? opts = null)
public OriginAccessIdentity(String name, OriginAccessIdentityArgs args)
public OriginAccessIdentity(String name, OriginAccessIdentityArgs args, CustomResourceOptions options)
type: aws:cloudfront:OriginAccessIdentity
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args OriginAccessIdentityArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args OriginAccessIdentityArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args OriginAccessIdentityArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args OriginAccessIdentityArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args OriginAccessIdentityArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

OriginAccessIdentity Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The OriginAccessIdentity resource accepts the following input properties:

Comment string

An optional comment for the origin access identity.

Comment string

An optional comment for the origin access identity.

comment String

An optional comment for the origin access identity.

comment string

An optional comment for the origin access identity.

comment str

An optional comment for the origin access identity.

comment String

An optional comment for the origin access identity.

Outputs

All input properties are implicitly available as output properties. Additionally, the OriginAccessIdentity resource produces the following output properties:

CallerReference string

Internal value used by CloudFront to allow future updates to the origin access identity.

CloudfrontAccessIdentityPath string

A shortcut to the full path for the origin access identity to use in CloudFront, see below.

Etag string

The current version of the origin access identity's information. For example: E2QWRUHAPOMQZL.

IamArn string

A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.

Id string

The provider-assigned unique ID for this managed resource.

S3CanonicalUserId string

The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.

CallerReference string

Internal value used by CloudFront to allow future updates to the origin access identity.

CloudfrontAccessIdentityPath string

A shortcut to the full path for the origin access identity to use in CloudFront, see below.

Etag string

The current version of the origin access identity's information. For example: E2QWRUHAPOMQZL.

IamArn string

A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.

Id string

The provider-assigned unique ID for this managed resource.

S3CanonicalUserId string

The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.

callerReference String

Internal value used by CloudFront to allow future updates to the origin access identity.

cloudfrontAccessIdentityPath String

A shortcut to the full path for the origin access identity to use in CloudFront, see below.

etag String

The current version of the origin access identity's information. For example: E2QWRUHAPOMQZL.

iamArn String

A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.

id String

The provider-assigned unique ID for this managed resource.

s3CanonicalUserId String

The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.

callerReference string

Internal value used by CloudFront to allow future updates to the origin access identity.

cloudfrontAccessIdentityPath string

A shortcut to the full path for the origin access identity to use in CloudFront, see below.

etag string

The current version of the origin access identity's information. For example: E2QWRUHAPOMQZL.

iamArn string

A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.

id string

The provider-assigned unique ID for this managed resource.

s3CanonicalUserId string

The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.

caller_reference str

Internal value used by CloudFront to allow future updates to the origin access identity.

cloudfront_access_identity_path str

A shortcut to the full path for the origin access identity to use in CloudFront, see below.

etag str

The current version of the origin access identity's information. For example: E2QWRUHAPOMQZL.

iam_arn str

A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.

id str

The provider-assigned unique ID for this managed resource.

s3_canonical_user_id str

The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.

callerReference String

Internal value used by CloudFront to allow future updates to the origin access identity.

cloudfrontAccessIdentityPath String

A shortcut to the full path for the origin access identity to use in CloudFront, see below.

etag String

The current version of the origin access identity's information. For example: E2QWRUHAPOMQZL.

iamArn String

A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.

id String

The provider-assigned unique ID for this managed resource.

s3CanonicalUserId String

The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.

Look up Existing OriginAccessIdentity Resource

Get an existing OriginAccessIdentity resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: OriginAccessIdentityState, opts?: CustomResourceOptions): OriginAccessIdentity
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        caller_reference: Optional[str] = None,
        cloudfront_access_identity_path: Optional[str] = None,
        comment: Optional[str] = None,
        etag: Optional[str] = None,
        iam_arn: Optional[str] = None,
        s3_canonical_user_id: Optional[str] = None) -> OriginAccessIdentity
func GetOriginAccessIdentity(ctx *Context, name string, id IDInput, state *OriginAccessIdentityState, opts ...ResourceOption) (*OriginAccessIdentity, error)
public static OriginAccessIdentity Get(string name, Input<string> id, OriginAccessIdentityState? state, CustomResourceOptions? opts = null)
public static OriginAccessIdentity get(String name, Output<String> id, OriginAccessIdentityState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CallerReference string

Internal value used by CloudFront to allow future updates to the origin access identity.

CloudfrontAccessIdentityPath string

A shortcut to the full path for the origin access identity to use in CloudFront, see below.

Comment string

An optional comment for the origin access identity.

Etag string

The current version of the origin access identity's information. For example: E2QWRUHAPOMQZL.

IamArn string

A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.

S3CanonicalUserId string

The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.

CallerReference string

Internal value used by CloudFront to allow future updates to the origin access identity.

CloudfrontAccessIdentityPath string

A shortcut to the full path for the origin access identity to use in CloudFront, see below.

Comment string

An optional comment for the origin access identity.

Etag string

The current version of the origin access identity's information. For example: E2QWRUHAPOMQZL.

IamArn string

A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.

S3CanonicalUserId string

The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.

callerReference String

Internal value used by CloudFront to allow future updates to the origin access identity.

cloudfrontAccessIdentityPath String

A shortcut to the full path for the origin access identity to use in CloudFront, see below.

comment String

An optional comment for the origin access identity.

etag String

The current version of the origin access identity's information. For example: E2QWRUHAPOMQZL.

iamArn String

A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.

s3CanonicalUserId String

The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.

callerReference string

Internal value used by CloudFront to allow future updates to the origin access identity.

cloudfrontAccessIdentityPath string

A shortcut to the full path for the origin access identity to use in CloudFront, see below.

comment string

An optional comment for the origin access identity.

etag string

The current version of the origin access identity's information. For example: E2QWRUHAPOMQZL.

iamArn string

A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.

s3CanonicalUserId string

The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.

caller_reference str

Internal value used by CloudFront to allow future updates to the origin access identity.

cloudfront_access_identity_path str

A shortcut to the full path for the origin access identity to use in CloudFront, see below.

comment str

An optional comment for the origin access identity.

etag str

The current version of the origin access identity's information. For example: E2QWRUHAPOMQZL.

iam_arn str

A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.

s3_canonical_user_id str

The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.

callerReference String

Internal value used by CloudFront to allow future updates to the origin access identity.

cloudfrontAccessIdentityPath String

A shortcut to the full path for the origin access identity to use in CloudFront, see below.

comment String

An optional comment for the origin access identity.

etag String

The current version of the origin access identity's information. For example: E2QWRUHAPOMQZL.

iamArn String

A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.

s3CanonicalUserId String

The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.

Import

Cloudfront Origin Access Identities can be imported using the id, e.g.,

 $ pulumi import aws:cloudfront/originAccessIdentity:OriginAccessIdentity origin_access E74FTE3AEXAMPLE

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.