SingleWeightPolicyConfigProperty Struct
Configure a policy that CloudFront uses to route requests to different origins or use different cache settings, based on the weight assigned to each option.
This property is legacy. We recommend that you use TrafficConfig and specify the SingleWeightConfig property instead.
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 singleWeightPolicyConfigProperty: cloudfront.CfnContinuousDeploymentPolicy.SingleWeightPolicyConfigProperty = {
weight: 123,
// the properties below are optional
sessionStickinessConfig: {
idleTtl: 123,
maximumTtl: 123,
},
};
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
single_weight_policy_config_property = cloudfront.CfnContinuousDeploymentPolicy.SingleWeightPolicyConfigProperty(
weight=123,
# the properties below are optional
session_stickiness_config=cloudfront.CfnContinuousDeploymentPolicy.SessionStickinessConfigProperty(
idle_ttl=123,
maximum_ttl=123
)
)
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.*;
SingleWeightPolicyConfigProperty singleWeightPolicyConfigProperty = SingleWeightPolicyConfigProperty.builder()
.weight(123)
// the properties below are optional
.sessionStickinessConfig(SessionStickinessConfigProperty.builder()
.idleTtl(123)
.maximumTtl(123)
.build())
.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 singleWeightPolicyConfigProperty = new SingleWeightPolicyConfigProperty {
Weight = 123,
// the properties below are optional
SessionStickinessConfig = new SessionStickinessConfigProperty {
IdleTtl = 123,
MaximumTtl = 123
}
};
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"
singleWeightPolicyConfigProperty := &SingleWeightPolicyConfigProperty{
Weight: jsii.Number(123),
// the properties below are optional
SessionStickinessConfig: &SessionStickinessConfigProperty{
IdleTtl: jsii.Number(123),
MaximumTtl: jsii.Number(123),
},
}
Properties
sessionStickinessConfigoptionalIResolvable | CfnContinuousDeploymentPolicy.SessionStickinessConfigPropertysession_stickiness_configoptionaltyping.Union[IResolvable, SessionStickinessConfigProperty]sessionStickinessConfigoptionalIResolvableSessionStickinessConfigoptionalIResolvableSessionStickinessConfigoptionalinterface{}#Enable session stickiness for the associated origin or cache settings.
The percentage of requests that CloudFront will use to send to an associated origin or cache settings.