interface CustomOriginConfig
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.CloudFront.CustomOriginConfig |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscloudfront#CustomOriginConfig |
Java | software.amazon.awscdk.services.cloudfront.CustomOriginConfig |
Python | aws_cdk.aws_cloudfront.CustomOriginConfig |
TypeScript (source) | aws-cdk-lib » aws_cloudfront » CustomOriginConfig |
A custom origin configuration.
Example
declare const sourceBucket: s3.Bucket;
declare const oai: cloudfront.OriginAccessIdentity;
new cloudfront.CloudFrontWebDistribution(this, 'MyCfWebDistribution', {
originConfigs: [
{
s3OriginSource: {
s3BucketSource: sourceBucket,
originAccessIdentity: oai,
},
behaviors: [ {isDefaultBehavior: true}],
},
{
customOriginSource: {
domainName: 'MYALIAS',
},
behaviors: [{ pathPattern: '/somewhere' }]
}
],
});
Properties
| Name | Type | Description |
|---|---|---|
| domain | string | The domain name of the custom origin. |
| allowed | Origin[] | The SSL versions to use when interacting with the origin. |
| http | number | The origin HTTP port. |
| https | number | The origin HTTPS port. |
| origin | { [string]: string } | Any additional headers to pass to the origin. |
| origin | Duration | The keep alive timeout when making calls in seconds. |
| origin | string | The relative path to the origin root to use for sources. |
| origin | Origin | The protocol (http or https) policy to use when interacting with the origin. |
| origin | Duration | The read timeout when calling the origin in seconds. |
| 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. |
domainName
Type:
string
The domain name of the custom origin.
Should not include the path - that should be in the parent SourceConfiguration
allowedOriginSSLVersions?
Type:
Origin[]
(optional, default: OriginSslPolicy.TLS_V1_2)
The SSL versions to use when interacting with the origin.
httpPort?
Type:
number
(optional, default: 80)
The origin HTTP port.
httpsPort?
Type:
number
(optional, default: 443)
The origin HTTPS port.
originHeaders?
Type:
{ [string]: string }
(optional, default: No additional headers are passed.)
Any additional headers to pass to the origin.
originKeepaliveTimeout?
Type:
Duration
(optional, default: Duration.seconds(5))
The keep alive timeout when making calls in seconds.
originPath?
Type:
string
(optional, default: /)
The relative path to the origin root to use for sources.
originProtocolPolicy?
Type:
Origin
(optional, default: OriginProtocolPolicy.HttpsOnly)
The protocol (http or https) policy to use when interacting with the origin.
originReadTimeout?
Type:
Duration
(optional, default: Duration.seconds(30))
The read timeout when calling the origin in seconds.
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
Go
Java
Python
TypeScript (