Skip to content
v2.277.0

TrafficRoutingConfigProperty Struct ​

The configuration that specifies how traffic is shifted from one version of a Lambda function to another version during an AWS Lambda deployment, or from one Amazon ECS task set to another during an Amazon ECS deployment.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codedeploy as codedeploy } from 'aws-cdk-lib';
const trafficRoutingConfigProperty: codedeploy.CfnDeploymentConfig.TrafficRoutingConfigProperty = {
  type: 'type',

  // the properties below are optional
  timeBasedCanary: {
    canaryInterval: 123,
    canaryPercentage: 123,
  },
  timeBasedLinear: {
    linearInterval: 123,
    linearPercentage: 123,
  },
};
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_codedeploy as codedeploy

traffic_routing_config_property = codedeploy.CfnDeploymentConfig.TrafficRoutingConfigProperty(
    type="type",

    # the properties below are optional
    time_based_canary=codedeploy.CfnDeploymentConfig.TimeBasedCanaryProperty(
        canary_interval=123,
        canary_percentage=123
    ),
    time_based_linear=codedeploy.CfnDeploymentConfig.TimeBasedLinearProperty(
        linear_interval=123,
        linear_percentage=123
    )
)
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.codedeploy.*;

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

        // the properties below are optional
        .timeBasedCanary(TimeBasedCanaryProperty.builder()
                .canaryInterval(123)
                .canaryPercentage(123)
                .build())
        .timeBasedLinear(TimeBasedLinearProperty.builder()
                .linearInterval(123)
                .linearPercentage(123)
                .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.AWS.CodeDeploy;

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

    // the properties below are optional
    TimeBasedCanary = new TimeBasedCanaryProperty {
        CanaryInterval = 123,
        CanaryPercentage = 123
    },
    TimeBasedLinear = new TimeBasedLinearProperty {
        LinearInterval = 123,
        LinearPercentage = 123
    }
};
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
	TimeBasedCanary: &TimeBasedCanaryProperty{
		CanaryInterval: jsii.Number(123),
		CanaryPercentage: jsii.Number(123),
	},
	TimeBasedLinear: &TimeBasedLinearProperty{
		LinearInterval: jsii.Number(123),
		LinearPercentage: jsii.Number(123),
	},
}

Properties ​

timeBasedCanaryoptionalIResolvable | CfnDeploymentConfig.TimeBasedCanaryPropertytime_based_canaryoptionaltyping.Union[IResolvable, TimeBasedCanaryProperty]timeBasedCanaryoptionalIResolvableTimeBasedCanaryoptionalIResolvableTimeBasedCanaryoptionalinterface{}#
A configuration that shifts traffic from one version of a Lambda function or ECS task set to another in two increments.

The original and target Lambda function versions or ECS task sets are specified in the deployment's AppSpec file.

timeBasedLinearoptionalIResolvable | CfnDeploymentConfig.TimeBasedLinearPropertytime_based_linearoptionaltyping.Union[IResolvable, TimeBasedLinearProperty]timeBasedLinearoptionalIResolvableTimeBasedLinearoptionalIResolvableTimeBasedLinearoptionalinterface{}#
A configuration that shifts traffic from one version of a Lambda function or Amazon ECS task set to another in equal increments, with an equal number of minutes between each increment.

The original and target Lambda function versions or Amazon ECS task sets are specified in the deployment's AppSpec file.

typestringtypestrtypeStringTypestringType*stringrequired#
The type of traffic shifting ( `TimeBasedCanary` or `TimeBasedLinear` ) used by a deployment configuration.