Show / Hide Table of Contents

Class OriginAccessIdentity

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.

Inheritance
object
Resource
OriginAccessIdentity
Implements
IOriginAccessIdentity
IResource
IConstruct
IDependable
IGrantable
Inherited Members
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(string, IArnComponents)
Resource.GetResourceNameAttribute(string)
Resource.Env
Resource.PhysicalName
Resource.Stack
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class OriginAccessIdentity : Resource, IOriginAccessIdentity, IResource, IConstruct, IDependable, IGrantable
Syntax (vb)
Public Class OriginAccessIdentity Inherits Resource Implements IOriginAccessIdentity, IResource, IConstruct, IDependable, IGrantable
Remarks

Resource: AWS::CloudFront::CloudFrontOriginAccessIdentity

ExampleMetadata: infused

Examples
var myBucket = new Bucket(this, "myBucket");
             var myOai = new OriginAccessIdentity(this, "myOAI", new OriginAccessIdentityProps {
                 Comment = "My custom OAI"
             });
             var s3Origin = S3BucketOrigin.WithOriginAccessIdentity(myBucket, new S3BucketOriginWithOAIProps {
                 OriginAccessIdentity = myOai
             });
             new Distribution(this, "myDist", new DistributionProps {
                 DefaultBehavior = new BehaviorOptions {
                     Origin = s3Origin
                 }
             });

Synopsis

Constructors

OriginAccessIdentity(Construct, string, IOriginAccessIdentityProps?)

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.

Properties

CloudFrontOriginAccessIdentityS3CanonicalUserId

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.

GrantPrincipal

Derived principal value for bucket access.

OriginAccessIdentityId

The Origin Access Identity Id (physical id) This was called originAccessIdentityName before.

OriginAccessIdentityName

(deprecated) The Origin Access Identity Id (physical id) It is misnamed and superseded by the correctly named originAccessIdentityId.

PROPERTY_INJECTION_ID

Uniquely identifies this class.

Methods

Arn()

The ARN to include in S3 bucket policy to allow CloudFront access.

FromOriginAccessIdentityId(Construct, string, string)

Creates a OriginAccessIdentity by providing the OriginAccessIdentityId.

FromOriginAccessIdentityName(Construct, string, string)

(deprecated) Creates a OriginAccessIdentity by providing the OriginAccessIdentityId.

Constructors

OriginAccessIdentity(Construct, string, IOriginAccessIdentityProps?)

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.

public OriginAccessIdentity(Construct scope, string id, IOriginAccessIdentityProps? props = null)
Parameters
scope Construct
id string
props IOriginAccessIdentityProps
Remarks

Resource: AWS::CloudFront::CloudFrontOriginAccessIdentity

ExampleMetadata: infused

Examples
var myBucket = new Bucket(this, "myBucket");
             var myOai = new OriginAccessIdentity(this, "myOAI", new OriginAccessIdentityProps {
                 Comment = "My custom OAI"
             });
             var s3Origin = S3BucketOrigin.WithOriginAccessIdentity(myBucket, new S3BucketOriginWithOAIProps {
                 OriginAccessIdentity = myOai
             });
             new Distribution(this, "myDist", new DistributionProps {
                 DefaultBehavior = new BehaviorOptions {
                     Origin = s3Origin
                 }
             });

Properties

CloudFrontOriginAccessIdentityS3CanonicalUserId

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.

public virtual string CloudFrontOriginAccessIdentityS3CanonicalUserId { get; }
Property Value

string

Remarks

Attribute: true

GrantPrincipal

Derived principal value for bucket access.

public virtual IPrincipal GrantPrincipal { get; }
Property Value

IPrincipal

Remarks

Resource: AWS::CloudFront::CloudFrontOriginAccessIdentity

ExampleMetadata: infused

OriginAccessIdentityId

The Origin Access Identity Id (physical id) This was called originAccessIdentityName before.

public virtual string OriginAccessIdentityId { get; }
Property Value

string

Remarks

Attribute: true

OriginAccessIdentityName

(deprecated) The Origin Access Identity Id (physical id) It is misnamed and superseded by the correctly named originAccessIdentityId.

[Obsolete("use originAccessIdentityId instead")]
public virtual string OriginAccessIdentityName { get; }
Property Value

string

Remarks

Stability: Deprecated

Attribute: true

PROPERTY_INJECTION_ID

Uniquely identifies this class.

public static string PROPERTY_INJECTION_ID { get; }
Property Value

string

Remarks

Resource: AWS::CloudFront::CloudFrontOriginAccessIdentity

ExampleMetadata: infused

Methods

Arn()

The ARN to include in S3 bucket policy to allow CloudFront access.

protected virtual string Arn()
Returns

string

Remarks

Resource: AWS::CloudFront::CloudFrontOriginAccessIdentity

ExampleMetadata: infused

FromOriginAccessIdentityId(Construct, string, string)

Creates a OriginAccessIdentity by providing the OriginAccessIdentityId.

public static IOriginAccessIdentity FromOriginAccessIdentityId(Construct scope, string id, string originAccessIdentityId)
Parameters
scope Construct
id string
originAccessIdentityId string
Returns

IOriginAccessIdentity

Remarks

Resource: AWS::CloudFront::CloudFrontOriginAccessIdentity

ExampleMetadata: infused

FromOriginAccessIdentityName(Construct, string, string)

(deprecated) Creates a OriginAccessIdentity by providing the OriginAccessIdentityId.

[Obsolete("use `fromOriginAccessIdentityId`")]
public static IOriginAccessIdentity FromOriginAccessIdentityName(Construct scope, string id, string originAccessIdentityName)
Parameters
scope Construct
id string
originAccessIdentityName string
Returns

IOriginAccessIdentity

Remarks

It is misnamed and superseded by the correctly named fromOriginAccessIdentityId.

Stability: Deprecated

Implements

IOriginAccessIdentity
IResource
Constructs.IConstruct
Constructs.IDependable
IGrantable
Back to top Generated by DocFX