Skip to content
v2.277.0

CfnTrafficRouting Struct ​

Type of the CfnCodeDeployBlueGreenEcsAttributes.trafficRouting property.

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',
  },
};
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 = cdk.CfnTrafficRouting(
    prod_traffic_route=cdk.CfnTrafficRoute(
        logical_id="logicalId",
        type="type"
    ),
    target_groups=["targetGroups"],
    test_traffic_route=cdk.CfnTrafficRoute(
        logical_id="logicalId",
        type="type"
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;

CfnTrafficRouting cfnTrafficRouting = CfnTrafficRouting.builder()
        .prodTrafficRoute(CfnTrafficRoute.builder()
                .logicalId("logicalId")
                .type("type")
                .build())
        .targetGroups(List.of("targetGroups"))
        .testTrafficRoute(CfnTrafficRoute.builder()
                .logicalId("logicalId")
                .type("type")
                .build())
        .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;

var cfnTrafficRouting = new CfnTrafficRouting {
    ProdTrafficRoute = new CfnTrafficRoute {
        LogicalId = "logicalId",
        Type = "type"
    },
    TargetGroups = new [] { "targetGroups" },
    TestTrafficRoute = new CfnTrafficRoute {
        LogicalId = "logicalId",
        Type = "type"
    }
};
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"

cfnTrafficRouting := &CfnTrafficRouting{
	ProdTrafficRoute: &CfnTrafficRoute{
		LogicalId: jsii.String("logicalId"),
		Type: jsii.String("type"),
	},
	TargetGroups: []*string{
		jsii.String("targetGroups"),
	},
	TestTrafficRoute: &CfnTrafficRoute{
		LogicalId: jsii.String("logicalId"),
		Type: jsii.String("type"),
	},
}

Properties ​

prodTrafficRouteCfnTrafficRouteprod_traffic_routeCfnTrafficRouteprodTrafficRouteCfnTrafficRouteProdTrafficRouteCfnTrafficRouteProdTrafficRouteCfnTrafficRouterequired#
The listener to be used by your load balancer to direct traffic to your target groups.
targetGroupsstring[]target_groupstyping.List[str]targetGroupsList<String>TargetGroupsstring[]TargetGroups*[]*stringrequired#
The logical IDs of the blue and green, respectively, AWS::ElasticLoadBalancingV2::TargetGroup target groups.
testTrafficRouteCfnTrafficRoutetest_traffic_routeCfnTrafficRoutetestTrafficRouteCfnTrafficRouteTestTrafficRouteCfnTrafficRouteTestTrafficRouteCfnTrafficRouterequired#
The listener to be used by your load balancer to direct traffic to your target groups.