TrafficRouting

class aws_cdk.aws_codedeploy.TrafficRouting

Bases: object

Represents how traffic is shifted during a CodeDeploy deployment.

ExampleMetadata:

infused

Example:

config = codedeploy.LambdaDeploymentConfig(self, "CustomConfig",
    traffic_routing=codedeploy.TimeBasedCanaryTrafficRouting(
        interval=Duration.minutes(15),
        percentage=5
    ),
    deployment_config_name="MyDeploymentConfig"
)

Methods

abstract bind(scope)

Returns the traffic routing configuration.

Parameters:

scope (Construct) –

Return type:

TrafficRoutingConfig

Static Methods

classmethod all_at_once()

Shifts 100% of traffic in a single shift.

Return type:

TrafficRouting

classmethod time_based_canary(*, interval, percentage)

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

Parameters:
  • interval (Duration) – The amount of time between traffic shifts.

  • percentage (Union[int, float]) – The percentage to increase traffic on each traffic shift.

Return type:

TrafficRouting

classmethod time_based_linear(*, interval, percentage)

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

Parameters:
  • interval (Duration) – The amount of time between traffic shifts.

  • percentage (Union[int, float]) – The percentage to increase traffic on each traffic shift.

Return type:

TrafficRouting