Skip to content
v2.275.0

TrafficRouting Class ​

Represents how traffic is shifted during a CodeDeploy deployment.

Example ​

ts
const config = new codedeploy.LambdaDeploymentConfig(this, 'CustomConfig', {
  trafficRouting: new codedeploy.TimeBasedCanaryTrafficRouting({
    interval: Duration.minutes(15),
    percentage: 5,
  }),
  deploymentConfigName: 'MyDeploymentConfig',
});

Initializer ​

ts
new TrafficRouting()
python
TrafficRouting()
java
new TrafficRouting()
csharp
new TrafficRouting()
go
NewTrafficRouting()

Methods ​

allAtOnce(): TrafficRouting // chainable@staticmethod def all_at_once() -> TrafficRoutingpublic static TrafficRouting allAtOnce()public static TrafficRouting AllAtOnce()func AllAtOnce() TrafficRoutingstatic#
Shifts 100% of traffic in a single shift.
bind(scope: Construct): TrafficRoutingConfigdef bind(self, scope: Construct) -> TrafficRoutingConfigpublic TrafficRoutingConfig bind(Construct scope)public TrafficRoutingConfig Bind(Construct scope)func Bind(Scope Construct) TrafficRoutingConfig#
Returns the traffic routing configuration.
timeBasedCanary(props: TimeBasedCanaryTrafficRoutingProps): TrafficRouting // chainable@staticmethod def time_based_canary(props: TimeBasedCanaryTrafficRoutingProps) -> TrafficRoutingpublic static TrafficRouting timeBasedCanary(TimeBasedCanaryTrafficRoutingProps props)public static TrafficRouting TimeBasedCanary(TimeBasedCanaryTrafficRoutingProps props)func TimeBasedCanary(Props TimeBasedCanaryTrafficRoutingProps) TrafficRoutingstatic#
Shifts a specified percentage of traffic, waits for a specified amount of time, then shifts the rest of traffic.
timeBasedLinear(props: TimeBasedLinearTrafficRoutingProps): TrafficRouting // chainable@staticmethod def time_based_linear(props: TimeBasedLinearTrafficRoutingProps) -> TrafficRoutingpublic static TrafficRouting timeBasedLinear(TimeBasedLinearTrafficRoutingProps props)public static TrafficRouting TimeBasedLinear(TimeBasedLinearTrafficRoutingProps props)func TimeBasedLinear(Props TimeBasedLinearTrafficRoutingProps) TrafficRoutingstatic#
Keeps shifting a specified percentage of traffic until reaching 100%, waiting for a specified amount of time in between each traffic shift.