TimeBasedCanaryTrafficRouting

class aws_cdk.aws_codedeploy.TimeBasedCanaryTrafficRouting(*, interval, percentage)

Bases: TrafficRouting

Define a traffic routing config of type ‘TimeBasedCanary’.

ExampleMetadata:

infused

Example:

config = codedeploy.LambdaDeploymentConfig(self, "CustomConfig",
    traffic_routing=codedeploy.TimeBasedCanaryTrafficRouting(
        interval=Duration.minutes(15),
        percentage=5
    ),
    deployment_config_name="MyDeploymentConfig"
)
Parameters:
  • interval (Duration) – The amount of time between traffic shifts.

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

Methods

bind(_scope)

Return a TrafficRoutingConfig of type TimeBasedCanary.

Parameters:

_scope (Construct) –

Return type:

TrafficRoutingConfig

Attributes

interval

The amount of time between additional traffic shifts.

percentage

The percentage to increase traffic on each traffic shift.

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