Module: AWSCDK::Autoscaling::IAutoScalingGroup
- Includes:
- IAM::IGrantable, IResource, Interfaces::AWSAutoscaling::IAutoScalingGroupRef
- Included in:
- AutoScalingGroup
- Defined in:
- autoscaling/i_auto_scaling_group.rb
Overview
An AutoScalingGroup.
Class Method Summary collapse
Instance Method Summary collapse
-
#add_lifecycle_hook(id, props) ⇒ AWSCDK::Autoscaling::LifecycleHook
Send a message to either an SQS queue or SNS topic when instances launch or terminate.
-
#add_user_data(*commands) ⇒ void
Add command to the startup script of fleet instances.
-
#add_warm_pool(options = nil) ⇒ AWSCDK::Autoscaling::WarmPool
Add a pool of pre-initialized EC2 instances that sits alongside an Auto Scaling group.
-
#apply_removal_policy(policy) ⇒ void
Apply the given removal policy to this resource.
-
#auto_scaling_group_arn ⇒ String
The arn of the AutoScalingGroup.
-
#auto_scaling_group_name ⇒ String
The name of the AutoScalingGroup.
-
#auto_scaling_group_ref ⇒ AWSCDK::Interfaces::AWSAutoscaling::AutoScalingGroupReference
A reference to a AutoScalingGroup resource.
-
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
-
#grant_principal ⇒ AWSCDK::IAM::IPrincipal
The principal to grant permissions to.
-
#node ⇒ Constructs::Node
The tree node.
-
#os_type ⇒ AWSCDK::EC2::OperatingSystemType
The operating system family that the instances in this auto-scaling group belong to.
-
#scale_on_cpu_utilization(id, props) ⇒ AWSCDK::Autoscaling::TargetTrackingScalingPolicy
Scale out or in to achieve a target CPU utilization.
-
#scale_on_incoming_bytes(id, props) ⇒ AWSCDK::Autoscaling::TargetTrackingScalingPolicy
Scale out or in to achieve a target network ingress rate.
-
#scale_on_metric(id, props) ⇒ AWSCDK::Autoscaling::StepScalingPolicy
Scale out or in, in response to a metric.
-
#scale_on_outgoing_bytes(id, props) ⇒ AWSCDK::Autoscaling::TargetTrackingScalingPolicy
Scale out or in to achieve a target network egress rate.
-
#scale_on_schedule(id, props) ⇒ AWSCDK::Autoscaling::ScheduledAction
Scale out or in based on time.
-
#scale_to_track_metric(id, props) ⇒ AWSCDK::Autoscaling::TargetTrackingScalingPolicy
Scale out or in in order to keep a metric around a target value.
-
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Class Method Details
.jsii_overridable_methods ⇒ Object
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'autoscaling/i_auto_scaling_group.rb', line 215 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :env => { kind: :property, name: "env", is_optional: false }, :auto_scaling_group_ref => { kind: :property, name: "autoScalingGroupRef", is_optional: false }, :stack => { kind: :property, name: "stack", is_optional: false }, :grant_principal => { kind: :property, name: "grantPrincipal", is_optional: false }, :auto_scaling_group_arn => { kind: :property, name: "autoScalingGroupArn", is_optional: false }, :auto_scaling_group_name => { kind: :property, name: "autoScalingGroupName", is_optional: false }, :os_type => { kind: :property, name: "osType", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false }, :add_lifecycle_hook => { kind: :method, name: "addLifecycleHook", is_optional: false }, :add_user_data => { kind: :method, name: "addUserData", is_optional: false }, :add_warm_pool => { kind: :method, name: "addWarmPool", is_optional: false }, :scale_on_cpu_utilization => { kind: :method, name: "scaleOnCpuUtilization", is_optional: false }, :scale_on_incoming_bytes => { kind: :method, name: "scaleOnIncomingBytes", is_optional: false }, :scale_on_metric => { kind: :method, name: "scaleOnMetric", is_optional: false }, :scale_on_outgoing_bytes => { kind: :method, name: "scaleOnOutgoingBytes", is_optional: false }, :scale_on_schedule => { kind: :method, name: "scaleOnSchedule", is_optional: false }, :scale_to_track_metric => { kind: :method, name: "scaleToTrackMetric", is_optional: false }, } end |
Instance Method Details
#add_lifecycle_hook(id, props) ⇒ AWSCDK::Autoscaling::LifecycleHook
Send a message to either an SQS queue or SNS topic when instances launch or terminate.
112 113 114 115 116 117 |
# File 'autoscaling/i_auto_scaling_group.rb', line 112 def add_lifecycle_hook(id, props) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") props = props.is_a?(Hash) ? ::AWSCDK::Autoscaling::BasicLifecycleHookProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuQmFzaWNMaWZlY3ljbGVIb29rUHJvcHMifQ==")), "props") jsii_call_method("addLifecycleHook", [id, props]) end |
#add_user_data(*commands) ⇒ void
This method returns an undefined value.
Add command to the startup script of fleet instances.
The command must be in the scripting language supported by the fleet's OS (i.e. Linux/Windows). Does nothing for imported ASGs.
126 127 128 129 130 131 |
# File 'autoscaling/i_auto_scaling_group.rb', line 126 def add_user_data(*commands) commands.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "commands[#{index}]") end jsii_call_method("addUserData", [*commands]) end |
#add_warm_pool(options = nil) ⇒ AWSCDK::Autoscaling::WarmPool
Add a pool of pre-initialized EC2 instances that sits alongside an Auto Scaling group.
137 138 139 140 141 |
# File 'autoscaling/i_auto_scaling_group.rb', line 137 def add_warm_pool( = nil) = .is_a?(Hash) ? ::AWSCDK::Autoscaling::WarmPoolOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuV2FybVBvb2xPcHRpb25zIn0=")), "options") unless .nil? jsii_call_method("addWarmPool", []) end |
#apply_removal_policy(policy) ⇒ void
This method returns an undefined value.
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
102 103 104 105 |
# File 'autoscaling/i_auto_scaling_group.rb', line 102 def apply_removal_policy(policy) Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy") jsii_call_method("applyRemovalPolicy", [policy]) end |
#auto_scaling_group_arn ⇒ String
The arn of the AutoScalingGroup.
56 57 58 |
# File 'autoscaling/i_auto_scaling_group.rb', line 56 def auto_scaling_group_arn() jsii_get_property("autoScalingGroupArn") end |
#auto_scaling_group_name ⇒ String
The name of the AutoScalingGroup.
63 64 65 |
# File 'autoscaling/i_auto_scaling_group.rb', line 63 def auto_scaling_group_name() jsii_get_property("autoScalingGroupName") end |
#auto_scaling_group_ref ⇒ AWSCDK::Interfaces::AWSAutoscaling::AutoScalingGroupReference
A reference to a AutoScalingGroup resource.
35 36 37 |
# File 'autoscaling/i_auto_scaling_group.rb', line 35 def auto_scaling_group_ref() jsii_get_property("autoScalingGroupRef") end |
#env ⇒ AWSCDK::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.
28 29 30 |
# File 'autoscaling/i_auto_scaling_group.rb', line 28 def env() jsii_get_property("env") end |
#grant_principal ⇒ AWSCDK::IAM::IPrincipal
The principal to grant permissions to.
49 50 51 |
# File 'autoscaling/i_auto_scaling_group.rb', line 49 def grant_principal() jsii_get_property("grantPrincipal") end |
#node ⇒ Constructs::Node
The tree node.
13 14 15 |
# File 'autoscaling/i_auto_scaling_group.rb', line 13 def node() jsii_get_property("node") end |
#os_type ⇒ AWSCDK::EC2::OperatingSystemType
The operating system family that the instances in this auto-scaling group belong to.
Is 'UNKNOWN' for imported ASGs.
72 73 74 |
# File 'autoscaling/i_auto_scaling_group.rb', line 72 def os_type() jsii_get_property("osType") end |
#scale_on_cpu_utilization(id, props) ⇒ AWSCDK::Autoscaling::TargetTrackingScalingPolicy
Scale out or in to achieve a target CPU utilization.
148 149 150 151 152 153 |
# File 'autoscaling/i_auto_scaling_group.rb', line 148 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::Autoscaling::CpuUtilizationScalingProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuQ3B1VXRpbGl6YXRpb25TY2FsaW5nUHJvcHMifQ==")), "props") jsii_call_method("scaleOnCpuUtilization", [id, props]) end |
#scale_on_incoming_bytes(id, props) ⇒ AWSCDK::Autoscaling::TargetTrackingScalingPolicy
Scale out or in to achieve a target network ingress rate.
160 161 162 163 164 165 |
# File 'autoscaling/i_auto_scaling_group.rb', line 160 def scale_on_incoming_bytes(id, props) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") props = props.is_a?(Hash) ? ::AWSCDK::Autoscaling::NetworkUtilizationScalingProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuTmV0d29ya1V0aWxpemF0aW9uU2NhbGluZ1Byb3BzIn0=")), "props") jsii_call_method("scaleOnIncomingBytes", [id, props]) end |
#scale_on_metric(id, props) ⇒ AWSCDK::Autoscaling::StepScalingPolicy
Scale out or in, in response to a metric.
172 173 174 175 176 177 |
# File 'autoscaling/i_auto_scaling_group.rb', line 172 def scale_on_metric(id, props) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") props = props.is_a?(Hash) ? ::AWSCDK::Autoscaling::BasicStepScalingPolicyProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuQmFzaWNTdGVwU2NhbGluZ1BvbGljeVByb3BzIn0=")), "props") jsii_call_method("scaleOnMetric", [id, props]) end |
#scale_on_outgoing_bytes(id, props) ⇒ AWSCDK::Autoscaling::TargetTrackingScalingPolicy
Scale out or in to achieve a target network egress rate.
184 185 186 187 188 189 |
# File 'autoscaling/i_auto_scaling_group.rb', line 184 def scale_on_outgoing_bytes(id, props) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") props = props.is_a?(Hash) ? ::AWSCDK::Autoscaling::NetworkUtilizationScalingProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuTmV0d29ya1V0aWxpemF0aW9uU2NhbGluZ1Byb3BzIn0=")), "props") jsii_call_method("scaleOnOutgoingBytes", [id, props]) end |
#scale_on_schedule(id, props) ⇒ AWSCDK::Autoscaling::ScheduledAction
Scale out or in based on time.
196 197 198 199 200 201 |
# File 'autoscaling/i_auto_scaling_group.rb', line 196 def scale_on_schedule(id, props) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") props = props.is_a?(Hash) ? ::AWSCDK::Autoscaling::BasicScheduledActionProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuQmFzaWNTY2hlZHVsZWRBY3Rpb25Qcm9wcyJ9")), "props") jsii_call_method("scaleOnSchedule", [id, props]) end |
#scale_to_track_metric(id, props) ⇒ AWSCDK::Autoscaling::TargetTrackingScalingPolicy
Scale out or in in order to keep a metric around a target value.
208 209 210 211 212 213 |
# File 'autoscaling/i_auto_scaling_group.rb', line 208 def scale_to_track_metric(id, props) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") props = props.is_a?(Hash) ? ::AWSCDK::Autoscaling::MetricTargetTrackingProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuTWV0cmljVGFyZ2V0VHJhY2tpbmdQcm9wcyJ9")), "props") jsii_call_method("scaleToTrackMetric", [id, props]) end |
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
42 43 44 |
# File 'autoscaling/i_auto_scaling_group.rb', line 42 def stack() jsii_get_property("stack") 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.
83 84 85 86 87 88 |
# File 'autoscaling/i_auto_scaling_group.rb', line 83 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 |