interface S3BucketOriginWithOAIProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CloudFront.Origins.S3BucketOriginWithOAIProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscloudfrontorigins#S3BucketOriginWithOAIProps |
![]() | software.amazon.awscdk.services.cloudfront.origins.S3BucketOriginWithOAIProps |
![]() | aws_cdk.aws_cloudfront_origins.S3BucketOriginWithOAIProps |
![]() | aws-cdk-lib » aws_cloudfront_origins » S3BucketOriginWithOAIProps |
Properties for configuring a S3 origin with OAI.
Example
const myBucket = new s3.Bucket(this, 'myBucket');
const myOai = new cloudfront.OriginAccessIdentity(this, 'myOAI', {
comment: 'My custom OAI'
});
const s3Origin = origins.S3BucketOrigin.withOriginAccessIdentity(myBucket, {
originAccessIdentity: myOai
});
new cloudfront.Distribution(this, 'myDist', {
defaultBehavior: {
origin: s3Origin
},
});
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 | string | The unique identifier of an origin access control for this origin. |
origin | IOrigin | An optional Origin Access Identity. |
origin | string | A unique identifier for the origin. |
origin | string | An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin. |
origin | boolean | Origin Shield is enabled by setting originShieldRegion to a valid region, after this to disable Origin Shield again you must set this flag to false. |
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.
originAccessControlId?
Type:
string
(optional, default: no origin access control)
The unique identifier of an origin access control for this origin.
originAccessIdentity?
Type:
IOrigin
(optional, default: an Origin Access Identity will be created.)
An optional Origin Access Identity.
originId?
Type:
string
(optional, default: an originid will be generated for you)
A unique identifier for the origin.
This value must be unique within the distribution.
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').
originShieldEnabled?
Type:
boolean
(optional, default: true)
Origin Shield is enabled by setting originShieldRegion to a valid region, after this to disable Origin Shield again you must set this flag to false.
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.