# CfnTrafficRouting

Type of the `CfnCodeDeployBlueGreenEcsAttributes.trafficRouting` property.

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

## Example

```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 cfnTrafficRouting: cdk.CfnTrafficRouting = {
  prodTrafficRoute: {
    logicalId: 'logicalId',
    type: 'type',
  },
  targetGroups: ['targetGroups'],
  testTrafficRoute: {
    logicalId: 'logicalId',
    type: 'type',
  },
};
```

## Properties

- `prodTrafficRoute`: [CfnTrafficRoute](/cdk/api/v2/docs/aws-cdk-lib.CfnTrafficRoute.html) (required) — The listener to be used by your load balancer to direct traffic to your target groups.

- `targetGroups`: string[] (required) — The logical IDs of the blue and green, respectively, AWS::ElasticLoadBalancingV2::TargetGroup target groups.

- `testTrafficRoute`: [CfnTrafficRoute](/cdk/api/v2/docs/aws-cdk-lib.CfnTrafficRoute.html) (required) — The listener to be used by your load balancer to direct traffic to your target groups.
