# TrafficRoutingConfigProperty

Struct · External

Defines the traffic routing strategy during an endpoint deployment to shift traffic from the old fleet to the new fleet.

- 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_sagemaker as sagemaker } from 'aws-cdk-lib';
const trafficRoutingConfigProperty: sagemaker.CfnEndpoint.TrafficRoutingConfigProperty = {
  type: 'type',

  // the properties below are optional
  canarySize: {
    type: 'type',
    value: 123,
  },
  linearStepSize: {
    type: 'type',
    value: 123,
  },
  waitIntervalInSeconds: 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_sagemaker as sagemaker

traffic_routing_config_property = sagemaker.CfnEndpoint.TrafficRoutingConfigProperty(
    type="type",

    # the properties below are optional
    canary_size=sagemaker.CfnEndpoint.CapacitySizeProperty(
        type="type",
        value=123
    ),
    linear_step_size=sagemaker.CfnEndpoint.CapacitySizeProperty(
        type="type",
        value=123
    ),
    wait_interval_in_seconds=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.sagemaker.*;

TrafficRoutingConfigProperty trafficRoutingConfigProperty = TrafficRoutingConfigProperty.builder()
        .type("type")

        // the properties below are optional
        .canarySize(CapacitySizeProperty.builder()
                .type("type")
                .value(123)
                .build())
        .linearStepSize(CapacitySizeProperty.builder()
                .type("type")
                .value(123)
                .build())
        .waitIntervalInSeconds(123)
        .build();
```

C#:

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

var trafficRoutingConfigProperty = new TrafficRoutingConfigProperty {
    Type = "type",

    // the properties below are optional
    CanarySize = new CapacitySizeProperty {
        Type = "type",
        Value = 123
    },
    LinearStepSize = new CapacitySizeProperty {
        Type = "type",
        Value = 123
    },
    WaitIntervalInSeconds = 123
};
```

Go:

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

trafficRoutingConfigProperty := &TrafficRoutingConfigProperty{
	Type: jsii.String("type"),

	// the properties below are optional
	CanarySize: &CapacitySizeProperty{
		Type: jsii.String("type"),
		Value: jsii.Number(123),
	},
	LinearStepSize: &CapacitySizeProperty{
		Type: jsii.String("type"),
		Value: jsii.Number(123),
	},
	WaitIntervalInSeconds: jsii.Number(123),
}
```

## Properties

- `canarySize`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEndpoint.CapacitySizeProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnEndpoint.CapacitySizeProperty.html) — Batch size for the first step to turn on traffic on the new endpoint fleet.

  `Value` must be less than or equal to 50% of the variant's total instance count.

- `linearStepSize`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEndpoint.CapacitySizeProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnEndpoint.CapacitySizeProperty.html) — Batch size for each step to turn on traffic on the new endpoint fleet.

  `Value` must be 10-50% of the variant's total instance count.

- `type`: string (required) — Traffic routing strategy type.

  - `ALL_AT_ONCE` : Endpoint traffic shifts to the new fleet in a single step.
  - `CANARY` : Endpoint traffic shifts to the new fleet in two steps. The first step is the canary, which is a small portion of the traffic. The second step is the remainder of the traffic.
  - `LINEAR` : Endpoint traffic shifts to the new fleet in n steps of a configurable size.

- `waitIntervalInSeconds`: number — The waiting time (in seconds) between incremental steps to turn on traffic on the new endpoint fleet.
