interface OriginGroupProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CloudFront.Origins.OriginGroupProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscloudfrontorigins#OriginGroupProps |
Java | software.amazon.awscdk.services.cloudfront.origins.OriginGroupProps |
Python | aws_cdk.aws_cloudfront_origins.OriginGroupProps |
TypeScript (source) | aws-cdk-lib » aws_cloudfront_origins » OriginGroupProps |
Construction properties for OriginGroup
.
Example
const myBucket = new s3.Bucket(this, 'myBucket');
new cloudfront.Distribution(this, 'myDist', {
defaultBehavior: {
origin: new origins.OriginGroup({
primaryOrigin: origins.S3BucketOrigin.withOriginAccessControl(myBucket),
fallbackOrigin: new origins.HttpOrigin('www.example.com'),
// optional, defaults to: 500, 502, 503 and 504
fallbackStatusCodes: [404],
}),
},
});
Properties
Name | Type | Description |
---|---|---|
fallback | IOrigin | The fallback origin that should serve requests when the primary fails. |
primary | IOrigin | The primary origin that should serve requests for this group. |
fallback | number[] | The list of HTTP status codes that, when returned from the primary origin, would cause querying the fallback origin. |
fallbackOrigin
Type:
IOrigin
The fallback origin that should serve requests when the primary fails.
primaryOrigin
Type:
IOrigin
The primary origin that should serve requests for this group.
fallbackStatusCodes?
Type:
number[]
(optional, default: 500, 502, 503 and 504)
The list of HTTP status codes that, when returned from the primary origin, would cause querying the fallback origin.