Class: AWSCDK::ECS::ScalableTaskCount

Inherits:
ApplicationAutoScaling::BaseScalableAttribute
  • Object
show all
Defined in:
ecs/scalable_task_count.rb

Overview

The scalable attribute representing task count.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props) ⇒ ScalableTaskCount

Constructs a new instance of the ScalableTaskCount class.

Parameters:



13
14
15
16
17
18
19
# File 'ecs/scalable_task_count.rb', line 13

def initialize(scope, id, props)
  props = props.is_a?(Hash) ? ::AWSCDK::ECS::ScalableTaskCountProps.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("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlNjYWxhYmxlVGFza0NvdW50UHJvcHMifQ==")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.jsii_overridable_methodsObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'ecs/scalable_task_count.rb', line 21

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :props => { kind: :property, name: "props", is_optional: false },
    :scalable_target_ref => { kind: :property, name: "scalableTargetRef", is_optional: false },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :do_scale_on_metric => { kind: :method, name: "doScaleOnMetric", is_optional: false },
    :do_scale_on_schedule => { kind: :method, name: "doScaleOnSchedule", is_optional: false },
    :do_scale_to_track_metric => { kind: :method, name: "doScaleToTrackMetric", is_optional: false },
    :scale_on_cpu_utilization => { kind: :method, name: "scaleOnCpuUtilization", is_optional: false },
    :scale_on_memory_utilization => { kind: :method, name: "scaleOnMemoryUtilization", is_optional: false },
    :scale_on_metric => { kind: :method, name: "scaleOnMetric", is_optional: false },
    :scale_on_request_count => { kind: :method, name: "scaleOnRequestCount", is_optional: false },
    :scale_on_schedule => { kind: :method, name: "scaleOnSchedule", is_optional: false },
    :scale_to_track_custom_metric => { kind: :method, name: "scaleToTrackCustomMetric", is_optional: false },
  }
end

Instance Method Details

#do_scale_on_metric(id, props) ⇒ void

This method returns an undefined value.

Scale out or in based on a metric value.



103
104
105
106
107
108
# File 'ecs/scalable_task_count.rb', line 103

def do_scale_on_metric(id, props)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::BasicStepScalingPolicyProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbGljYXRpb25hdXRvc2NhbGluZy5CYXNpY1N0ZXBTY2FsaW5nUG9saWN5UHJvcHMifQ==")), "props")
  jsii_call_method("doScaleOnMetric", [id, props])
end

#do_scale_on_schedule(id, props) ⇒ void

This method returns an undefined value.

Scale out or in based on time.

Parameters:



115
116
117
118
119
120
# File 'ecs/scalable_task_count.rb', line 115

def do_scale_on_schedule(id, props)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::ScalingSchedule.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbGljYXRpb25hdXRvc2NhbGluZy5TY2FsaW5nU2NoZWR1bGUifQ==")), "props")
  jsii_call_method("doScaleOnSchedule", [id, props])
end

#do_scale_to_track_metric(id, props) ⇒ void

This method returns an undefined value.

Scale out or in in order to keep a metric around a target value.



127
128
129
130
131
132
# File 'ecs/scalable_task_count.rb', line 127

def do_scale_to_track_metric(id, props)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::BasicTargetTrackingScalingPolicyProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbGljYXRpb25hdXRvc2NhbGluZy5CYXNpY1RhcmdldFRyYWNraW5nU2NhbGluZ1BvbGljeVByb3BzIn0=")), "props")
  jsii_call_method("doScaleToTrackMetric", [id, props])
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



59
60
61
# File 'ecs/scalable_task_count.rb', line 59

def env()
  jsii_get_property("env")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


44
45
46
# File 'ecs/scalable_task_count.rb', line 44

def node()
  jsii_get_property("node")
end

#propsAWSCDK::ApplicationAutoScaling::BaseScalableAttributeProps



64
65
66
# File 'ecs/scalable_task_count.rb', line 64

def props()
  jsii_get_property("props")
end

#scalable_target_refAWSCDK::Interfaces::AWSApplicationautoscaling::ScalableTargetReference

A reference to a ScalableTarget resource.



71
72
73
# File 'ecs/scalable_task_count.rb', line 71

def scalable_target_ref()
  jsii_get_property("scalableTargetRef")
end

#scale_on_cpu_utilization(id, props) ⇒ void

This method returns an undefined value.

Scales in or out to achieve a target CPU utilization.

Parameters:



139
140
141
142
143
144
# File 'ecs/scalable_task_count.rb', line 139

def scale_on_cpu_utilization(id, props)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ECS::CpuUtilizationScalingProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNwdVV0aWxpemF0aW9uU2NhbGluZ1Byb3BzIn0=")), "props")
  jsii_call_method("scaleOnCpuUtilization", [id, props])
end

#scale_on_memory_utilization(id, props) ⇒ void

This method returns an undefined value.

Scales in or out to achieve a target memory utilization.

Parameters:



151
152
153
154
155
156
# File 'ecs/scalable_task_count.rb', line 151

def scale_on_memory_utilization(id, props)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ECS::MemoryUtilizationScalingProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLk1lbW9yeVV0aWxpemF0aW9uU2NhbGluZ1Byb3BzIn0=")), "props")
  jsii_call_method("scaleOnMemoryUtilization", [id, props])
end

#scale_on_metric(id, props) ⇒ void

This method returns an undefined value.

Scales in or out based on a specified metric value.



163
164
165
166
167
168
# File 'ecs/scalable_task_count.rb', line 163

def scale_on_metric(id, props)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::BasicStepScalingPolicyProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbGljYXRpb25hdXRvc2NhbGluZy5CYXNpY1N0ZXBTY2FsaW5nUG9saWN5UHJvcHMifQ==")), "props")
  jsii_call_method("scaleOnMetric", [id, props])
end

#scale_on_request_count(id, props) ⇒ void

This method returns an undefined value.

Scales in or out to achieve a target Application Load Balancer request count per target.

Parameters:



175
176
177
178
179
180
# File 'ecs/scalable_task_count.rb', line 175

def scale_on_request_count(id, props)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ECS::RequestCountScalingProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlJlcXVlc3RDb3VudFNjYWxpbmdQcm9wcyJ9")), "props")
  jsii_call_method("scaleOnRequestCount", [id, props])
end

#scale_on_schedule(id, props) ⇒ void

This method returns an undefined value.

Scales in or out based on a specified scheduled time.

Parameters:



187
188
189
190
191
192
# File 'ecs/scalable_task_count.rb', line 187

def scale_on_schedule(id, props)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::ScalingSchedule.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbGljYXRpb25hdXRvc2NhbGluZy5TY2FsaW5nU2NoZWR1bGUifQ==")), "props")
  jsii_call_method("scaleOnSchedule", [id, props])
end

#scale_to_track_custom_metric(id, props) ⇒ void

This method returns an undefined value.

Scales in or out to achieve a target on a custom metric.

Parameters:



199
200
201
202
203
204
# File 'ecs/scalable_task_count.rb', line 199

def scale_to_track_custom_metric(id, props)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ECS::TrackCustomMetricProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlRyYWNrQ3VzdG9tTWV0cmljUHJvcHMifQ==")), "props")
  jsii_call_method("scaleToTrackCustomMetric", [id, props])
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


78
79
80
# File 'ecs/scalable_task_count.rb', line 78

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



91
92
93
94
95
96
# File 'ecs/scalable_task_count.rb', line 91

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