Class: AWSCDK::ECS::CfnService::CanaryConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs/cfn_service.rb

Overview

Configuration for a canary deployment strategy that shifts a fixed percentage of traffic to the new service revision, waits for a specified bake time, then shifts the remaining traffic.

The following validation applies only to Canary deployments created through CloudFormation . CloudFormation operations time out after 36 hours. Canary deployments can approach this limit because of their extended duration. This can cause CloudFormation to roll back the deployment. To prevent timeout-related rollbacks, CloudFormation rejects deployments when the calculated deployment time exceeds 33 hours based on your template configuration:

BakeTimeInMinutes + CanaryBakeTimeInMinutes

Additional backend processes (such as task scaling and running lifecycle hooks) can extend deployment time beyond these calculations. Even deployments under the 33-hour threshold might still time out if these processes cause the total duration to exceed 36 hours.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(canary_bake_time_in_minutes: nil, canary_percent: nil) ⇒ CanaryConfigurationProperty

Returns a new instance of CanaryConfigurationProperty.

Parameters:

  • canary_bake_time_in_minutes (Numeric, nil) (defaults to: nil)

    The amount of time in minutes to wait during the canary phase before shifting the remaining production traffic to the new service revision.

  • canary_percent (Numeric, nil) (defaults to: nil)

    The percentage of production traffic to shift to the new service revision during the canary phase.



1042
1043
1044
1045
1046
1047
# File 'ecs/cfn_service.rb', line 1042

def initialize(canary_bake_time_in_minutes: nil, canary_percent: nil)
  @canary_bake_time_in_minutes = canary_bake_time_in_minutes
  Jsii::Type.check_type(@canary_bake_time_in_minutes, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "canaryBakeTimeInMinutes") unless @canary_bake_time_in_minutes.nil?
  @canary_percent = canary_percent
  Jsii::Type.check_type(@canary_percent, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "canaryPercent") unless @canary_percent.nil?
end

Instance Attribute Details

#canary_bake_time_in_minutesNumeric? (readonly)

The amount of time in minutes to wait during the canary phase before shifting the remaining production traffic to the new service revision.

Valid values are 0 to 1440 minutes (24 hours). The default value is 10.



1055
1056
1057
# File 'ecs/cfn_service.rb', line 1055

def canary_bake_time_in_minutes
  @canary_bake_time_in_minutes
end

#canary_percentNumeric? (readonly)

The percentage of production traffic to shift to the new service revision during the canary phase.

Valid values are multiples of 0.1 from 0.1 to 100.0. The default value is 5.0.



1062
1063
1064
# File 'ecs/cfn_service.rb', line 1062

def canary_percent
  @canary_percent
end

Class Method Details

.jsii_propertiesObject



1064
1065
1066
1067
1068
1069
# File 'ecs/cfn_service.rb', line 1064

def self.jsii_properties
  {
    :canary_bake_time_in_minutes => "canaryBakeTimeInMinutes",
    :canary_percent => "canaryPercent",
  }
end

Instance Method Details

#to_jsiiObject



1071
1072
1073
1074
1075
1076
1077
1078
# File 'ecs/cfn_service.rb', line 1071

def to_jsii
  result = {}
  result.merge!({
    "canaryBakeTimeInMinutes" => @canary_bake_time_in_minutes,
    "canaryPercent" => @canary_percent,
  })
  result.compact
end