Class: AWSCDK::CodeDeploy::TrafficRoutingConfig
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CodeDeploy::TrafficRoutingConfig
- Defined in:
- code_deploy/traffic_routing_config.rb
Overview
Represents the structure to pass into the underlying CfnDeploymentConfig class.
Instance Attribute Summary collapse
-
#time_based_canary ⇒ AWSCDK::CodeDeploy::CanaryTrafficRoutingConfig?
readonly
A configuration that shifts traffic from one version of a Lambda function or ECS task set to another in two increments.
-
#time_based_linear ⇒ AWSCDK::CodeDeploy::LinearTrafficRoutingConfig?
readonly
A configuration that shifts traffic from one version of a Lambda function or Amazon ECS task set to another in equal increments, with an equal number of minutes between each increment.
-
#type ⇒ String
readonly
The type of traffic shifting (
TimeBasedCanaryorTimeBasedLinear) used by a deployment configuration.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type:, time_based_canary: nil, time_based_linear: nil) ⇒ TrafficRoutingConfig
constructor
A new instance of TrafficRoutingConfig.
- #to_jsii ⇒ Object
Constructor Details
#initialize(type:, time_based_canary: nil, time_based_linear: nil) ⇒ TrafficRoutingConfig
Returns a new instance of TrafficRoutingConfig.
10 11 12 13 14 15 16 17 |
# File 'code_deploy/traffic_routing_config.rb', line 10 def initialize(type:, time_based_canary: nil, time_based_linear: nil) @type = type Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type") @time_based_canary = time_based_canary.is_a?(Hash) ? ::AWSCDK::CodeDeploy::CanaryTrafficRoutingConfig.new(**time_based_canary.transform_keys(&:to_sym)) : time_based_canary Jsii::Type.check_type(@time_based_canary, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWRlcGxveS5DYW5hcnlUcmFmZmljUm91dGluZ0NvbmZpZyJ9")), "timeBasedCanary") unless @time_based_canary.nil? @time_based_linear = time_based_linear.is_a?(Hash) ? ::AWSCDK::CodeDeploy::LinearTrafficRoutingConfig.new(**time_based_linear.transform_keys(&:to_sym)) : time_based_linear Jsii::Type.check_type(@time_based_linear, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWRlcGxveS5MaW5lYXJUcmFmZmljUm91dGluZ0NvbmZpZyJ9")), "timeBasedLinear") unless @time_based_linear.nil? end |
Instance Attribute Details
#time_based_canary ⇒ AWSCDK::CodeDeploy::CanaryTrafficRoutingConfig? (readonly)
Default: none
A configuration that shifts traffic from one version of a Lambda function or ECS task set to another in two increments.
27 28 29 |
# File 'code_deploy/traffic_routing_config.rb', line 27 def time_based_canary @time_based_canary end |
#time_based_linear ⇒ AWSCDK::CodeDeploy::LinearTrafficRoutingConfig? (readonly)
Default: none
A configuration that shifts traffic from one version of a Lambda function or Amazon ECS task set to another in equal increments, with an equal number of minutes between each increment.
32 33 34 |
# File 'code_deploy/traffic_routing_config.rb', line 32 def time_based_linear @time_based_linear end |
#type ⇒ String (readonly)
The type of traffic shifting ( TimeBasedCanary or TimeBasedLinear ) used by a deployment configuration.
22 23 24 |
# File 'code_deploy/traffic_routing_config.rb', line 22 def type @type end |
Class Method Details
.jsii_properties ⇒ Object
34 35 36 37 38 39 40 |
# File 'code_deploy/traffic_routing_config.rb', line 34 def self.jsii_properties { :type => "type", :time_based_canary => "timeBasedCanary", :time_based_linear => "timeBasedLinear", } end |
Instance Method Details
#to_jsii ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'code_deploy/traffic_routing_config.rb', line 42 def to_jsii result = {} result.merge!({ "type" => @type, "timeBasedCanary" => @time_based_canary, "timeBasedLinear" => @time_based_linear, }) result.compact end |