S3OriginAccessControlProps

class aws_cdk.aws_cloudfront.S3OriginAccessControlProps(*, description=None, origin_access_control_name=None, signing=None)

Bases: OriginAccessControlBaseProps

Properties for creating a S3 Origin Access Control resource.

Parameters:
  • description (Optional[str]) – A description of the origin access control. Default: - no description

  • origin_access_control_name (Optional[str]) – A name to identify the origin access control, with a maximum length of 64 characters. Default: - a generated name

  • signing (Optional[Signing]) – Specifies which requests CloudFront signs and the signing protocol. Default: SIGV4_ALWAYS

ExampleMetadata:

infused

Example:

my_bucket = s3.Bucket(self, "myBucket")
oac = cloudfront.S3OriginAccessControl(self, "MyOAC",
    signing=cloudfront.Signing.SIGV4_NO_OVERRIDE
)
s3_origin = origins.S3BucketOrigin.with_origin_access_control(my_bucket,
    origin_access_control=oac
)
cloudfront.Distribution(self, "myDist",
    default_behavior=cloudfront.BehaviorOptions(
        origin=s3_origin
    )
)

Attributes

description

A description of the origin access control.

Default:
  • no description

origin_access_control_name

A name to identify the origin access control, with a maximum length of 64 characters.

Default:
  • a generated name

signing

Specifies which requests CloudFront signs and the signing protocol.

Default:

SIGV4_ALWAYS

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig-signingbehavior