aws-cdk-lib.aws_codedeploy.TrafficRouting

class TrafficRouting

LanguageType name
.NETAmazon.CDK.AWS.CodeDeploy.TrafficRouting
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodedeploy#TrafficRouting
Javasoftware.amazon.awscdk.services.codedeploy.TrafficRouting
Pythonaws_cdk.aws_codedeploy.TrafficRouting
TypeScript (source)aws-cdk-lib » aws_codedeploy » TrafficRouting

Implemented by AllAtOnceTrafficRouting, TimeBasedCanaryTrafficRouting, TimeBasedLinearTrafficRouting

Represents how traffic is shifted during a CodeDeploy deployment.

Example

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

Initializer

new TrafficRouting()

Methods

NameDescription
bind(scope)Returns the traffic routing configuration.
static allAtOnce()Shifts 100% of traffic in a single shift.
static timeBasedCanary(props)Shifts a specified percentage of traffic, waits for a specified amount of time, then shifts the rest of traffic.
static timeBasedLinear(props)Keeps shifting a specified percentage of traffic until reaching 100%, waiting for a specified amount of time in between each traffic shift.

bind(scope)

public bind(scope: Construct): TrafficRoutingConfig

Parameters

  • scope Construct

Returns

  • TrafficRoutingConfig

Returns the traffic routing configuration.


static allAtOnce()

public static allAtOnce(): TrafficRouting

Returns

  • TrafficRouting

Shifts 100% of traffic in a single shift.


static timeBasedCanary(props)

public static timeBasedCanary(props: TimeBasedCanaryTrafficRoutingProps): TrafficRouting

Parameters

  • props TimeBasedCanaryTrafficRoutingProps

Returns

  • TrafficRouting

Shifts a specified percentage of traffic, waits for a specified amount of time, then shifts the rest of traffic.


static timeBasedLinear(props)

public static timeBasedLinear(props: TimeBasedLinearTrafficRoutingProps): TrafficRouting

Parameters

  • props TimeBasedLinearTrafficRoutingProps

Returns

  • TrafficRouting

Keeps shifting a specified percentage of traffic until reaching 100%, waiting for a specified amount of time in between each traffic shift.