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.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class OriginAccessIdentity : Resource, IOriginAccessIdentity, IResource, IGrantable
Syntax (vb)
Public Class OriginAccessIdentity
Inherits Resource
Implements IOriginAccessIdentity, IResource, 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(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
OriginAccessIdentity(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
OriginAccessIdentity(Construct, String, IOriginAccessIdentityProps) |
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. |
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(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected OriginAccessIdentity(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
OriginAccessIdentity(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected OriginAccessIdentity(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
OriginAccessIdentity(Construct, String, IOriginAccessIdentityProps)
public OriginAccessIdentity(Construct scope, string id, IOriginAccessIdentityProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IOriginAccessIdentityProps
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
System.String
Remarks
Attribute: true
GrantPrincipal
Derived principal value for bucket access.
public virtual IPrincipal GrantPrincipal { get; }
Property Value
OriginAccessIdentityId
The Origin Access Identity Id (physical id) This was called originAccessIdentityName before.
public virtual string OriginAccessIdentityId { get; }
Property Value
System.String
Remarks
Attribute: true
OriginAccessIdentityName
(deprecated) The Origin Access Identity Id (physical id) It is misnamed and superseded by the correctly named originAccessIdentityId.
public virtual string OriginAccessIdentityName { get; }
Property Value
System.String
Remarks
Stability: Deprecated
Attribute: true
Methods
Arn()
The ARN to include in S3 bucket policy to allow CloudFront access.
protected virtual string Arn()
Returns
System.String
FromOriginAccessIdentityId(Construct, String, String)
Creates a OriginAccessIdentity by providing the OriginAccessIdentityId.
public static IOriginAccessIdentity FromOriginAccessIdentityId(Construct scope, string id, string originAccessIdentityId)
Parameters
- scope Constructs.Construct
- id System.String
- originAccessIdentityId System.String
Returns
FromOriginAccessIdentityName(Construct, String, String)
(deprecated) Creates a OriginAccessIdentity by providing the OriginAccessIdentityId.
public static IOriginAccessIdentity FromOriginAccessIdentityName(Construct scope, string id, string originAccessIdentityName)
Parameters
- scope Constructs.Construct
- id System.String
- originAccessIdentityName System.String
Returns
Remarks
It is misnamed and superseded by the correctly named fromOriginAccessIdentityId.
Stability: Deprecated