OriginAccessIdentityProps

class aws_cdk.aws_cloudfront.OriginAccessIdentityProps(*, comment=None)

Bases: object

Properties of CloudFront OriginAccessIdentity.

Parameters:

comment (Optional[str]) – Any comments you want to include about the origin access identity. Default: “Allows CloudFront to reach the bucket”

ExampleMetadata:

infused

Example:

my_bucket = s3.Bucket(self, "myBucket")
my_oai = cloudfront.OriginAccessIdentity(self, "myOAI",
    comment="My custom OAI"
)
s3_origin = origins.S3BucketOrigin.with_origin_access_identity(my_bucket,
    origin_access_identity=my_oai
)
cloudfront.Distribution(self, "myDist",
    default_behavior=cloudfront.BehaviorOptions(
        origin=s3_origin
    )
)

Attributes

comment

Any comments you want to include about the origin access identity.

Default:

“Allows CloudFront to reach the bucket”