aws-cdk-lib.aws_cloudfront_origins.OriginGroupProps

interface OriginGroupProps

LanguageType name
.NETAmazon.CDK.AWS.CloudFront.Origins.OriginGroupProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudfrontorigins#OriginGroupProps
Javasoftware.amazon.awscdk.services.cloudfront.origins.OriginGroupProps
Pythonaws_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: new origins.S3Origin(myBucket),
      fallbackOrigin: new origins.HttpOrigin('www.example.com'),
      // optional, defaults to: 500, 502, 503 and 504
      fallbackStatusCodes: [404],
    }),
  },
});

Properties

NameTypeDescription
fallbackOriginIOriginThe fallback origin that should serve requests when the primary fails.
primaryOriginIOriginThe primary origin that should serve requests for this group.
fallbackStatusCodes?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.