class OriginGroup
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CloudFront.Origins.OriginGroup |
Java | software.amazon.awscdk.services.cloudfront.origins.OriginGroup |
Python | aws_cdk.aws_cloudfront_origins.OriginGroup |
TypeScript (source) | @aws-cdk/aws-cloudfront-origins » OriginGroup |
Implements
IOrigin
An Origin that represents a group.
Consists of a primary Origin, and a fallback Origin called when the primary returns one of the provided HTTP status codes.
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],
}),
},
});
Initializer
new OriginGroup(props: OriginGroupProps)
Parameters
- props
Origin
Group Props
Methods
Name | Description |
---|---|
bind(scope, options) | The method called when a given Origin is added (for the first time) to a Distribution. |
bind(scope, options)
public bind(scope: Construct, options: OriginBindOptions): OriginBindConfig
Parameters
- scope
Construct
- options
Origin
Bind Options
Returns
The method called when a given Origin is added (for the first time) to a Distribution.