interface S3OriginConfig
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CloudFront.S3OriginConfig |
Java | software.amazon.awscdk.services.cloudfront.S3OriginConfig |
Python | aws_cdk.aws_cloudfront.S3OriginConfig |
TypeScript (source) | @aws-cdk/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
Name | Type | Description |
---|---|---|
s3 | IBucket | The source bucket to serve content from. |
origin | IOrigin | The optional Origin Access Identity of the origin identity cloudfront will use when calling your s3 bucket. |
origin | { [string]: string } | Any additional headers to pass to the origin. |
origin | string | The relative path to the origin root to use for sources. |
origin | string | When 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:
IOrigin
(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.