Skip to content
v2.278.0

SessionStickinessConfigProperty Struct ​

Session stickiness provides the ability to define multiple requests from a single viewer as a single session.

This prevents the potentially inconsistent experience of sending some of a given user's requests to your staging distribution, while others are sent to your primary distribution. Define the session duration using TTL values.

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 sessionStickinessConfigProperty: cloudfront.CfnContinuousDeploymentPolicy.SessionStickinessConfigProperty = {
  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

session_stickiness_config_property = 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.*;

SessionStickinessConfigProperty sessionStickinessConfigProperty = SessionStickinessConfigProperty.builder()
        .idleTtl(123)
        .maximumTtl(123)
        .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 sessionStickinessConfigProperty = 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"

sessionStickinessConfigProperty := &SessionStickinessConfigProperty{
	IdleTtl: jsii.Number(123),
	MaximumTtl: jsii.Number(123),
}

Properties ​

idleTtlnumberidle_ttlint | floatidleTtlNumberIdleTtldoubleIdleTtl*float64 required #
The amount of time after which you want sessions to cease if no requests are received.

Allowed values are 300–3600 seconds (5–60 minutes).

maximumTtlnumbermaximum_ttlint | floatmaximumTtlNumberMaximumTtldoubleMaximumTtl*float64 required #
The maximum amount of time to consider requests from the viewer as being part of the same session.

Allowed values are 300–3600 seconds (5–60 minutes).