Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

AWS::CloudFront::CloudFrontOriginAccessIdentity

Focus mode
AWS::CloudFront::CloudFrontOriginAccessIdentity - AWS CloudFormation
Filter View

The request to create a new origin access identity (OAI). An origin access identity is a special CloudFront user that you can associate with Amazon S3 origins, so that you can secure all or just some of your Amazon S3 content. For more information, see Restricting Access to Amazon S3 Content by Using an Origin Access Identity in the Amazon CloudFront Developer Guide.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::CloudFront::CloudFrontOriginAccessIdentity", "Properties" : { "CloudFrontOriginAccessIdentityConfig" : CloudFrontOriginAccessIdentityConfig } }

YAML

Type: AWS::CloudFront::CloudFrontOriginAccessIdentity Properties: CloudFrontOriginAccessIdentityConfig: CloudFrontOriginAccessIdentityConfig

Properties

CloudFrontOriginAccessIdentityConfig

The current configuration information for the identity.

Required: Yes

Type: CloudFrontOriginAccessIdentityConfig

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the origin access identity, such as E15MNIMTCFKK4C.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Id

The ID for the origin access identity, for example, E74FTE3AJFJ256A.

S3CanonicalUserId

The Amazon S3 canonical user ID for the origin access identity, used when giving the origin access identity read permission to an object in Amazon S3. For example: b970b42360b81c8ddbd79d2f5df0069ba9033c8a79655752abe380cd6d63ba8bcf23384d568fcf89fc49700b5e11a0fd.

Examples

Specify the comment for an origin access identity

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "cloudfrontoriginaccessidentity": { "Type": "AWS::CloudFront::CloudFrontOriginAccessIdentity", "Properties": { "CloudFrontOriginAccessIdentityConfig": { "Comment": "string-value" } } } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Resources: cloudfrontoriginaccessidentity: Type: AWS::CloudFront::CloudFrontOriginAccessIdentity Properties: CloudFrontOriginAccessIdentityConfig: Comment: string-value

See also

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.