aws-cdk-lib.aws_cloudfront.S3OriginConfig

interface S3OriginConfig

LanguageType name
.NETAmazon.CDK.AWS.CloudFront.S3OriginConfig
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudfront#S3OriginConfig
Javasoftware.amazon.awscdk.services.cloudfront.S3OriginConfig
Pythonaws_cdk.aws_cloudfront.S3OriginConfig
TypeScript (source)aws-cdk-lib » aws_cloudfront » S3OriginConfig

S3 origin configuration for CloudFront.

Example

declare const sourceBucket: s3.Bucket;
const viewerCertificate = cloudfront.ViewerCertificate.fromIamCertificate('MYIAMROLEIDENTIFIER', {
  aliases: ['MYALIAS'],
});

new cloudfront.CloudFrontWebDistribution(this, 'MyCfWebDistribution', {
  originConfigs: [
    {
      s3OriginSource: {
        s3BucketSource: sourceBucket,
      },
      behaviors : [ {isDefaultBehavior: true} ],
    },
  ],
  viewerCertificate: viewerCertificate,
});

Properties

NameTypeDescription
s3BucketSourceIBucketThe source bucket to serve content from.
originAccessIdentity?IOriginAccessIdentityThe optional Origin Access Identity of the origin identity cloudfront will use when calling your s3 bucket.
originHeaders?{ [string]: string }Any additional headers to pass to the origin.
originPath?stringThe relative path to the origin root to use for sources.
originShieldRegion?stringWhen you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.

s3BucketSource

Type: IBucket

The source bucket to serve content from.


originAccessIdentity?

Type: IOriginAccessIdentity (optional, default: No Origin Access Identity which requires the S3 bucket to be public accessible)

The optional Origin Access Identity of the origin identity cloudfront will use when calling your s3 bucket.


originHeaders?

Type: { [string]: string } (optional, default: No additional headers are passed.)

Any additional headers to pass to the origin.


originPath?

Type: string (optional, default: /)

The relative path to the origin root to use for sources.


originShieldRegion?

Type: string (optional, default: origin shield not enabled)

When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.