Class: AWSCDK::ECS::AsgCapacityProvider
- Inherits:
-
Constructs::Construct
- Object
- Constructs::Construct
- AWSCDK::ECS::AsgCapacityProvider
- Defined in:
- ecs/asg_capacity_provider.rb
Overview
An Auto Scaling Group Capacity Provider.
This allows an ECS cluster to target a specific EC2 Auto Scaling Group for the placement of tasks. Optionally (and recommended), ECS can manage the number of instances in the ASG to fit the tasks, and can ensure that instances are not prematurely terminated while there are still tasks running on them.
Class Method Summary collapse
- .jsii_overridable_methods ⇒ Object
-
.PROPERTY_INJECTION_ID ⇒ String
Uniquely identifies this class.
Instance Method Summary collapse
-
#auto_scaling_group ⇒ AWSCDK::Autoscaling::AutoScalingGroup
Auto Scaling Group.
-
#capacity_provider_name ⇒ String
Capacity provider name.
-
#enable_managed_draining ⇒ Boolean?
Whether managed draining is enabled.
-
#enable_managed_termination_protection ⇒ Boolean?
Whether managed termination protection is enabled.
-
#initialize(scope, id, props) ⇒ AsgCapacityProvider
constructor
A new instance of AsgCapacityProvider.
-
#machine_image_type ⇒ AWSCDK::ECS::MachineImageType
Auto Scaling Group machineImageType.
-
#node ⇒ Constructs::Node
The tree node.
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props) ⇒ AsgCapacityProvider
Returns a new instance of AsgCapacityProvider.
17 18 19 20 21 22 23 |
# File 'ecs/asg_capacity_provider.rb', line 17 def initialize(scope, id, props) props = props.is_a?(Hash) ? ::AWSCDK::ECS::AsgCapacityProviderProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkFzZ0NhcGFjaXR5UHJvdmlkZXJQcm9wcyJ9")), "props") Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'ecs/asg_capacity_provider.rb', line 25 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :auto_scaling_group => { kind: :property, name: "autoScalingGroup", is_optional: false }, :capacity_provider_name => { kind: :property, name: "capacityProviderName", is_optional: false }, :machine_image_type => { kind: :property, name: "machineImageType", is_optional: false }, :enable_managed_draining => { kind: :property, name: "enableManagedDraining", is_optional: true }, :enable_managed_termination_protection => { kind: :property, name: "enableManagedTerminationProtection", is_optional: true }, :to_string => { kind: :method, name: "toString", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, } end |
.PROPERTY_INJECTION_ID ⇒ String
Uniquely identifies this class.
48 49 50 |
# File 'ecs/asg_capacity_provider.rb', line 48 def self.PROPERTY_INJECTION_ID() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ecs.AsgCapacityProvider", "PROPERTY_INJECTION_ID") end |
Instance Method Details
#auto_scaling_group ⇒ AWSCDK::Autoscaling::AutoScalingGroup
Auto Scaling Group.
55 56 57 |
# File 'ecs/asg_capacity_provider.rb', line 55 def auto_scaling_group() jsii_get_property("autoScalingGroup") end |
#capacity_provider_name ⇒ String
Default: Chosen by CloudFormation
Capacity provider name.
63 64 65 |
# File 'ecs/asg_capacity_provider.rb', line 63 def capacity_provider_name() jsii_get_property("capacityProviderName") end |
#enable_managed_draining ⇒ Boolean?
Whether managed draining is enabled.
77 78 79 |
# File 'ecs/asg_capacity_provider.rb', line 77 def enable_managed_draining() jsii_get_property("enableManagedDraining") end |
#enable_managed_termination_protection ⇒ Boolean?
Whether managed termination protection is enabled.
84 85 86 |
# File 'ecs/asg_capacity_provider.rb', line 84 def enable_managed_termination_protection() jsii_get_property("enableManagedTerminationProtection") end |
#machine_image_type ⇒ AWSCDK::ECS::MachineImageType
Auto Scaling Group machineImageType.
70 71 72 |
# File 'ecs/asg_capacity_provider.rb', line 70 def machine_image_type() jsii_get_property("machineImageType") end |
#node ⇒ Constructs::Node
The tree node.
41 42 43 |
# File 'ecs/asg_capacity_provider.rb', line 41 def node() jsii_get_property("node") end |
#to_string ⇒ String
Returns a string representation of this construct.
91 92 93 |
# File 'ecs/asg_capacity_provider.rb', line 91 def to_string() jsii_call_method("toString", []) end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
104 105 106 107 108 109 |
# File 'ecs/asg_capacity_provider.rb', line 104 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |