Class OriginAccessIdentity

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.cloudfront.OriginAccessIdentity
All Implemented Interfaces:
IConstruct, IDependable, IResource, IOriginAccessIdentity, IGrantable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:43.724Z") @Stability(Stable) public class OriginAccessIdentity extends Resource implements IOriginAccessIdentity
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.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.cloudfront.*;
 OriginAccessIdentity originAccessIdentity = OriginAccessIdentity.Builder.create(this, "MyOriginAccessIdentity")
         .comment("comment")
         .build();
 
  • Constructor Details

    • OriginAccessIdentity

      protected OriginAccessIdentity(software.amazon.jsii.JsiiObjectRef objRef)
    • OriginAccessIdentity

      protected OriginAccessIdentity(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • OriginAccessIdentity

      @Stability(Stable) public OriginAccessIdentity(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable OriginAccessIdentityProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • OriginAccessIdentity

      @Stability(Stable) public OriginAccessIdentity(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • fromOriginAccessIdentityName

      @Stability(Stable) @NotNull public static IOriginAccessIdentity fromOriginAccessIdentityName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String originAccessIdentityName)
      Creates a OriginAccessIdentity by providing the OriginAccessIdentityName.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      originAccessIdentityName - This parameter is required.
    • arn

      @Stability(Stable) @NotNull protected String arn()
      The ARN to include in S3 bucket policy to allow CloudFront access.
    • getCloudFrontOriginAccessIdentityS3CanonicalUserId

      @Stability(Stable) @NotNull public String getCloudFrontOriginAccessIdentityS3CanonicalUserId()
      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.
    • getGrantPrincipal

      @Stability(Stable) @NotNull public IPrincipal getGrantPrincipal()
      Derived principal value for bucket access.
      Specified by:
      getGrantPrincipal in interface IGrantable
    • getOriginAccessIdentityName

      @Stability(Stable) @NotNull public String getOriginAccessIdentityName()
      The Origin Access Identity Name (physical id).
      Specified by:
      getOriginAccessIdentityName in interface IOriginAccessIdentity