Class: AWSCDK::ECS::CapacityProviderStrategy
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ECS::CapacityProviderStrategy
- Defined in:
- ecs/capacity_provider_strategy.rb
Overview
A Capacity Provider strategy to use for the service.
Instance Attribute Summary collapse
-
#base ⇒ Numeric?
readonly
The base value designates how many tasks, at a minimum, to run on the specified capacity provider.
-
#capacity_provider ⇒ String
readonly
The name of the capacity provider.
-
#weight ⇒ Numeric?
readonly
The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(capacity_provider:, base: nil, weight: nil) ⇒ CapacityProviderStrategy
constructor
A new instance of CapacityProviderStrategy.
- #to_jsii ⇒ Object
Constructor Details
#initialize(capacity_provider:, base: nil, weight: nil) ⇒ CapacityProviderStrategy
Returns a new instance of CapacityProviderStrategy.
10 11 12 13 14 15 16 17 |
# File 'ecs/capacity_provider_strategy.rb', line 10 def initialize(capacity_provider:, base: nil, weight: nil) @capacity_provider = capacity_provider Jsii::Type.check_type(@capacity_provider, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "capacityProvider") @base = base Jsii::Type.check_type(@base, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "base") unless @base.nil? @weight = weight Jsii::Type.check_type(@weight, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "weight") unless @weight.nil? end |
Instance Attribute Details
#base ⇒ Numeric? (readonly)
Default: - none
The base value designates how many tasks, at a minimum, to run on the specified capacity provider.
Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of 0 is used.
31 32 33 |
# File 'ecs/capacity_provider_strategy.rb', line 31 def base @base end |
#capacity_provider ⇒ String (readonly)
The name of the capacity provider.
22 23 24 |
# File 'ecs/capacity_provider_strategy.rb', line 22 def capacity_provider @capacity_provider end |
#weight ⇒ Numeric? (readonly)
Default: - 0
The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider.
The weight value is taken into consideration after the base value, if defined, is satisfied.
38 39 40 |
# File 'ecs/capacity_provider_strategy.rb', line 38 def weight @weight end |
Class Method Details
.jsii_properties ⇒ Object
40 41 42 43 44 45 46 |
# File 'ecs/capacity_provider_strategy.rb', line 40 def self.jsii_properties { :capacity_provider => "capacityProvider", :base => "base", :weight => "weight", } end |
Instance Method Details
#to_jsii ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'ecs/capacity_provider_strategy.rb', line 48 def to_jsii result = {} result.merge!({ "capacityProvider" => @capacity_provider, "base" => @base, "weight" => @weight, }) result.compact end |