# SingleWeightConfigProperty

This configuration determines the percentage of HTTP requests that are sent to the staging distribution.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```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 singleWeightConfigProperty: cloudfront.CfnContinuousDeploymentPolicy.SingleWeightConfigProperty = {
  weight: 123,

  // the properties below are optional
  sessionStickinessConfig: {
    idleTtl: 123,
    maximumTtl: 123,
  },
};
```

Python:

```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_config_property = cloudfront.CfnContinuousDeploymentPolicy.SingleWeightConfigProperty(
    weight=123,

    # the properties below are optional
    session_stickiness_config=cloudfront.CfnContinuousDeploymentPolicy.SessionStickinessConfigProperty(
        idle_ttl=123,
        maximum_ttl=123
    )
)
```

Java:

```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.*;

SingleWeightConfigProperty singleWeightConfigProperty = SingleWeightConfigProperty.builder()
        .weight(123)

        // the properties below are optional
        .sessionStickinessConfig(SessionStickinessConfigProperty.builder()
                .idleTtl(123)
                .maximumTtl(123)
                .build())
        .build();
```

C# / .NET:

```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 singleWeightConfigProperty = new SingleWeightConfigProperty {
    Weight = 123,

    // the properties below are optional
    SessionStickinessConfig = new SessionStickinessConfigProperty {
        IdleTtl = 123,
        MaximumTtl = 123
    }
};
```

Golang:

```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"

singleWeightConfigProperty := &SingleWeightConfigProperty{
	Weight: jsii.Number(123),

	// the properties below are optional
	SessionStickinessConfig: &SessionStickinessConfigProperty{
		IdleTtl: jsii.Number(123),
		MaximumTtl: jsii.Number(123),
	},
}
```

## Properties

- `sessionStickinessConfig`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnContinuousDeploymentPolicy.SessionStickinessConfigProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CfnContinuousDeploymentPolicy.SessionStickinessConfigProperty.html) — 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.

- `weight`: number (required) — The percentage of traffic to send to a staging distribution, expressed as a decimal number between 0 and 0.15. For example, a value of 0.10 means 10% of traffic is sent to the staging distribution.
