interface S3OriginProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.CloudFront.Origins.S3OriginProps |
Java | software.amazon.awscdk.services.cloudfront.origins.S3OriginProps |
Python | aws_cdk.aws_cloudfront_origins.S3OriginProps |
TypeScript (source) | @aws-cdk/aws-cloudfront-origins » S3OriginProps |
Properties to use to customize an S3 Origin.
Example
const myBucket = new s3.Bucket(this, 'myBucket');
new cloudfront.Distribution(this, 'myDist', {
defaultBehavior: { origin: new origins.S3Origin(myBucket, {
customHeaders: {
Foo: 'bar',
},
})},
});
Properties
| Name | Type | Description |
|---|---|---|
| connection | number | The number of times that CloudFront attempts to connect to the origin; |
| connection | Duration | The number of seconds that CloudFront waits when trying to establish a connection to the origin. |
| custom | { [string]: string } | A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. |
| origin | IOrigin | An optional Origin Access Identity of the origin identity cloudfront will use when calling your s3 bucket. |
| origin | string | An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin. |
| 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. |
connectionAttempts?
Type:
number
(optional, default: 3)
The number of times that CloudFront attempts to connect to the origin;
valid values are 1, 2, or 3 attempts.
connectionTimeout?
Type:
Duration
(optional, default: Duration.seconds(10))
The number of seconds that CloudFront waits when trying to establish a connection to the origin.
Valid values are 1-10 seconds, inclusive.
customHeaders?
Type:
{ [string]: string }
(optional, default: {})
A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.
originAccessIdentity?
Type:
IOrigin
(optional, default: An Origin Access Identity will be created.)
An optional Origin Access Identity of the origin identity cloudfront will use when calling your s3 bucket.
originPath?
Type:
string
(optional, default: '/')
An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin.
Must begin, but not end, with '/' (e.g., '/production/images').
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.

.NET
Java
Python
TypeScript (