Class OriginGroup
An Origin that represents a group.
Implements
Namespace: Amazon.CDK.AWS.CloudFront.Origins
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class OriginGroup : DeputyBase, IOrigin
Syntax (vb)
Public Class OriginGroup Inherits DeputyBase Implements IOrigin
Remarks
Consists of a primary Origin, and a fallback Origin called when the primary returns one of the provided HTTP status codes.
ExampleMetadata: infused
Examples
var myBucket = new Bucket(this, "myBucket");
new Distribution(this, "myDist", new DistributionProps {
DefaultBehavior = new BehaviorOptions {
Origin = new OriginGroup(new OriginGroupProps {
PrimaryOrigin = S3BucketOrigin.WithOriginAccessControl(myBucket),
FallbackOrigin = new HttpOrigin("www.example.com"),
// optional, defaults to: 500, 502, 503 and 504
FallbackStatusCodes = new [] { 404 }
})
}
});
Synopsis
Constructors
| OriginGroup(IOriginGroupProps) | An Origin that represents a group. |
Methods
| Bind(Construct, IOriginBindOptions) | The method called when a given Origin is added (for the first time) to a Distribution. |
Constructors
OriginGroup(IOriginGroupProps)
An Origin that represents a group.
public OriginGroup(IOriginGroupProps props)
Parameters
- props IOriginGroupProps
Remarks
Consists of a primary Origin, and a fallback Origin called when the primary returns one of the provided HTTP status codes.
ExampleMetadata: infused
Examples
var myBucket = new Bucket(this, "myBucket");
new Distribution(this, "myDist", new DistributionProps {
DefaultBehavior = new BehaviorOptions {
Origin = new OriginGroup(new OriginGroupProps {
PrimaryOrigin = S3BucketOrigin.WithOriginAccessControl(myBucket),
FallbackOrigin = new HttpOrigin("www.example.com"),
// optional, defaults to: 500, 502, 503 and 504
FallbackStatusCodes = new [] { 404 }
})
}
});
Methods
Bind(Construct, IOriginBindOptions)
The method called when a given Origin is added (for the first time) to a Distribution.
public virtual IOriginBindConfig Bind(Construct scope, IOriginBindOptions options)
Parameters
- scope Construct
- options IOriginBindOptions
Returns
Remarks
Consists of a primary Origin, and a fallback Origin called when the primary returns one of the provided HTTP status codes.
ExampleMetadata: infused