OriginGroupProperty Struct
An origin group includes two origins (a primary origin and a secondary origin to failover to) and a failover criteria that you specify.
You create an origin group to support origin failover in CloudFront. When you create or update a distribution, you can specify the origin group instead of a single origin, and CloudFront will failover from the primary origin to the secondary origin under the failover conditions that you've chosen.
Optionally, you can choose selection criteria for your origin group to specify how your origins are selected when your distribution routes viewer requests.
| Source | |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';
const originGroupProperty: cloudfront.CfnDistribution.OriginGroupProperty = {
failoverCriteria: {
statusCodes: {
items: [123],
quantity: 123,
},
},
id: 'id',
members: {
items: [{
originId: 'originId',
}],
quantity: 123,
},
// the properties below are optional
selectionCriteria: 'selectionCriteria',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudfront as cloudfront
origin_group_property = cloudfront.CfnDistribution.OriginGroupProperty(
failover_criteria=cloudfront.CfnDistribution.OriginGroupFailoverCriteriaProperty(
status_codes=cloudfront.CfnDistribution.StatusCodesProperty(
items=[123],
quantity=123
)
),
id="id",
members=cloudfront.CfnDistribution.OriginGroupMembersProperty(
items=[cloudfront.CfnDistribution.OriginGroupMemberProperty(
origin_id="originId"
)],
quantity=123
),
# the properties below are optional
selection_criteria="selectionCriteria"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudfront.*;
OriginGroupProperty originGroupProperty = OriginGroupProperty.builder()
.failoverCriteria(OriginGroupFailoverCriteriaProperty.builder()
.statusCodes(StatusCodesProperty.builder()
.items(List.of(123))
.quantity(123)
.build())
.build())
.id("id")
.members(OriginGroupMembersProperty.builder()
.items(List.of(OriginGroupMemberProperty.builder()
.originId("originId")
.build()))
.quantity(123)
.build())
// the properties below are optional
.selectionCriteria("selectionCriteria")
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudFront;
var originGroupProperty = new OriginGroupProperty {
FailoverCriteria = new OriginGroupFailoverCriteriaProperty {
StatusCodes = new StatusCodesProperty {
Items = new [] { 123 },
Quantity = 123
}
},
Id = "id",
Members = new OriginGroupMembersProperty {
Items = new [] { new OriginGroupMemberProperty {
OriginId = "originId"
} },
Quantity = 123
},
// the properties below are optional
SelectionCriteria = "selectionCriteria"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
originGroupProperty := &OriginGroupProperty{
FailoverCriteria: &OriginGroupFailoverCriteriaProperty{
StatusCodes: &StatusCodesProperty{
Items: []interface{}{
jsii.Number(123),
},
Quantity: jsii.Number(123),
},
},
Id: jsii.String("id"),
Members: &OriginGroupMembersProperty{
Items: []interface{}{
&OriginGroupMemberProperty{
OriginId: jsii.String("originId"),
},
},
Quantity: jsii.Number(123),
},
// the properties below are optional
SelectionCriteria: jsii.String("selectionCriteria"),
}
Properties
failoverCriteriaIResolvable | CfnDistribution.failover_criteriatyping.Union[IResolvable, OriginGroupFailoverCriteriaProperty]failoverCriteriaIResolvableFailoverCriteriaIResolvableFailoverCriteriainterface{} required #A complex type that contains information about the failover criteria for an origin group.
The origin group's ID.
membersIResolvable | CfnDistribution.memberstyping.Union[IResolvable, OriginGroupMembersProperty]membersIResolvableMembersIResolvableMembersinterface{} required #A complex type that contains information about the origins in an origin group.
selectionCriteriaoptionalstringselection_criteriaoptionalstrselectionCriteriaoptionalStringSelectionCriteriaoptionalstringSelectionCriteriaoptional*string #The selection criteria for the origin group.
For more information, see Create an origin group in the Amazon CloudFront Developer Guide .