Class: AWSCDK::ECS::AsgCapacityProvider

Inherits:
Constructs::Construct
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props) ⇒ AsgCapacityProvider

Returns a new instance of AsgCapacityProvider.

Parameters:



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_methodsObject



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_IDString

Uniquely identifies this class.

Returns:

  • (String)


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_groupAWSCDK::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_nameString

Note:

Default: Chosen by CloudFormation

Capacity provider name.

Returns:

  • (String)


63
64
65
# File 'ecs/asg_capacity_provider.rb', line 63

def capacity_provider_name()
  jsii_get_property("capacityProviderName")
end

#enable_managed_drainingBoolean?

Whether managed draining is enabled.

Returns:

  • (Boolean, nil)


77
78
79
# File 'ecs/asg_capacity_provider.rb', line 77

def enable_managed_draining()
  jsii_get_property("enableManagedDraining")
end

#enable_managed_termination_protectionBoolean?

Whether managed termination protection is enabled.

Returns:

  • (Boolean, nil)


84
85
86
# File 'ecs/asg_capacity_provider.rb', line 84

def enable_managed_termination_protection()
  jsii_get_property("enableManagedTerminationProtection")
end

#machine_image_typeAWSCDK::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

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


41
42
43
# File 'ecs/asg_capacity_provider.rb', line 41

def node()
  jsii_get_property("node")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


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.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



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