# CfnTrafficRoutingConfig

Traffic routing configuration settings.

The type of the `CfnCodeDeployBlueGreenHookProps.trafficRoutingConfig` property.

- Source: [`core/lib/cfn-codedeploy-blue-green-hook.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/core/lib/cfn-codedeploy-blue-green-hook.ts#L77)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const cfnTrafficRoutingConfig: cdk.CfnTrafficRoutingConfig = {
  type: cdk.CfnTrafficRoutingType.ALL_AT_ONCE,

  // the properties below are optional
  timeBasedCanary: {
    bakeTimeMins: 123,
    stepPercentage: 123,
  },
  timeBasedLinear: {
    bakeTimeMins: 123,
    stepPercentage: 123,
  },
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

cfn_traffic_routing_config = cdk.CfnTrafficRoutingConfig(
    type=cdk.CfnTrafficRoutingType.ALL_AT_ONCE,

    # the properties below are optional
    time_based_canary=cdk.CfnTrafficRoutingTimeBasedCanary(
        bake_time_mins=123,
        step_percentage=123
    ),
    time_based_linear=cdk.CfnTrafficRoutingTimeBasedLinear(
        bake_time_mins=123,
        step_percentage=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.*;

CfnTrafficRoutingConfig cfnTrafficRoutingConfig = CfnTrafficRoutingConfig.builder()
        .type(CfnTrafficRoutingType.ALL_AT_ONCE)

        // the properties below are optional
        .timeBasedCanary(CfnTrafficRoutingTimeBasedCanary.builder()
                .bakeTimeMins(123)
                .stepPercentage(123)
                .build())
        .timeBasedLinear(CfnTrafficRoutingTimeBasedLinear.builder()
                .bakeTimeMins(123)
                .stepPercentage(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;

var cfnTrafficRoutingConfig = new CfnTrafficRoutingConfig {
    Type = CfnTrafficRoutingType.ALL_AT_ONCE,

    // the properties below are optional
    TimeBasedCanary = new CfnTrafficRoutingTimeBasedCanary {
        BakeTimeMins = 123,
        StepPercentage = 123
    },
    TimeBasedLinear = new CfnTrafficRoutingTimeBasedLinear {
        BakeTimeMins = 123,
        StepPercentage = 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 cdk "github.com/aws/aws-cdk-go/awscdk"

cfnTrafficRoutingConfig := &CfnTrafficRoutingConfig{
	Type: cdk.CfnTrafficRoutingType_ALL_AT_ONCE,

	// the properties below are optional
	TimeBasedCanary: &CfnTrafficRoutingTimeBasedCanary{
		BakeTimeMins: jsii.Number(123),
		StepPercentage: jsii.Number(123),
	},
	TimeBasedLinear: &CfnTrafficRoutingTimeBasedLinear{
		BakeTimeMins: jsii.Number(123),
		StepPercentage: jsii.Number(123),
	},
}
```

## Properties

- `timeBasedCanary`: [CfnTrafficRoutingTimeBasedCanary](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTrafficRoutingTimeBasedCanary.html) = none — The configuration for traffic routing when `type` is `CfnTrafficRoutingType.TIME_BASED_CANARY`.

- `timeBasedLinear`: [CfnTrafficRoutingTimeBasedLinear](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTrafficRoutingTimeBasedLinear.html) = none — The configuration for traffic routing when `type` is `CfnTrafficRoutingType.TIME_BASED_LINEAR`.

- `type`: [CfnTrafficRoutingType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTrafficRoutingType.html) (required) — The type of traffic shifting used by the blue-green deployment configuration.
