interface OriginGroupProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CloudFront.Origins.OriginGroupProps |
![]() | software.amazon.awscdk.services.cloudfront.origins.OriginGroupProps |
![]() | aws_cdk.aws_cloudfront_origins.OriginGroupProps |
![]() | @aws-cdk/aws-cloudfront-origins » OriginGroupProps |
Construction properties for {@link OriginGroup}.
Example
const myBucket = new s3.Bucket(this, 'myBucket');
new cloudfront.Distribution(this, 'myDist', {
defaultBehavior: {
origin: new origins.OriginGroup({
primaryOrigin: new origins.S3Origin(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.