aws-sdk-autoscaling 1.33.0 → 1.38.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -138,7 +138,8 @@ module Aws::AutoScaling
138
138
  # Waiter polls an API operation until a resource enters a desired
139
139
  # state.
140
140
  #
141
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
141
+ # @note The waiting operation is performed on a copy. The original resource
142
+ # remains unchanged.
142
143
  #
143
144
  # ## Basic Usage
144
145
  #
@@ -151,13 +152,15 @@ module Aws::AutoScaling
151
152
  #
152
153
  # ## Example
153
154
  #
154
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
155
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
156
+ # instance.state.name == 'running'
157
+ # end
155
158
  #
156
159
  # ## Configuration
157
160
  #
158
161
  # You can configure the maximum number of polling attempts, and the
159
- # delay (in seconds) between each polling attempt. The waiting condition is set
160
- # by passing a block to {#wait_until}:
162
+ # delay (in seconds) between each polling attempt. The waiting condition is
163
+ # set by passing a block to {#wait_until}:
161
164
  #
162
165
  # # poll for ~25 seconds
163
166
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -188,17 +191,16 @@ module Aws::AutoScaling
188
191
  # # resource did not enter the desired state in time
189
192
  # end
190
193
  #
194
+ # @yieldparam [Resource] resource to be used in the waiting condition.
191
195
  #
192
- # @yield param [Resource] resource to be used in the waiting condition
193
- #
194
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
195
- # because the waiter has entered a state that it will not transition
196
- # out of, preventing success.
196
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
197
+ # terminates because the waiter has entered a state that it will not
198
+ # transition out of, preventing success.
197
199
  #
198
200
  # yet successful.
199
201
  #
200
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
201
- # while polling for a resource that is not expected.
202
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
203
+ # encountered while polling for a resource that is not expected.
202
204
  #
203
205
  # @raise [NotImplementedError] Raised when the resource does not
204
206
  #
@@ -339,7 +341,12 @@ module Aws::AutoScaling
339
341
  # not respect the grace period associated with the group.
340
342
  #
341
343
  # For more information about the health check grace period, see
342
- # CreateAutoScalingGroup.
344
+ # [CreateAutoScalingGroup][1] in the *Amazon EC2 Auto Scaling API
345
+ # Reference*.
346
+ #
347
+ #
348
+ #
349
+ # [1]: https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_CreateAutoScalingGroup.html
343
350
  # @return [EmptyStructure]
344
351
  def set_health(options = {})
345
352
  options = options.merge(instance_id: @id)
@@ -298,7 +298,8 @@ module Aws::AutoScaling
298
298
  # Waiter polls an API operation until a resource enters a desired
299
299
  # state.
300
300
  #
301
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
301
+ # @note The waiting operation is performed on a copy. The original resource
302
+ # remains unchanged.
302
303
  #
303
304
  # ## Basic Usage
304
305
  #
@@ -311,13 +312,15 @@ module Aws::AutoScaling
311
312
  #
312
313
  # ## Example
313
314
  #
314
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
315
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
316
+ # instance.state.name == 'running'
317
+ # end
315
318
  #
316
319
  # ## Configuration
317
320
  #
318
321
  # You can configure the maximum number of polling attempts, and the
319
- # delay (in seconds) between each polling attempt. The waiting condition is set
320
- # by passing a block to {#wait_until}:
322
+ # delay (in seconds) between each polling attempt. The waiting condition is
323
+ # set by passing a block to {#wait_until}:
321
324
  #
322
325
  # # poll for ~25 seconds
323
326
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -348,17 +351,16 @@ module Aws::AutoScaling
348
351
  # # resource did not enter the desired state in time
349
352
  # end
350
353
  #
354
+ # @yieldparam [Resource] resource to be used in the waiting condition.
351
355
  #
352
- # @yield param [Resource] resource to be used in the waiting condition
353
- #
354
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
355
- # because the waiter has entered a state that it will not transition
356
- # out of, preventing success.
356
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
357
+ # terminates because the waiter has entered a state that it will not
358
+ # transition out of, preventing success.
357
359
  #
358
360
  # yet successful.
359
361
  #
360
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
361
- # while polling for a resource that is not expected.
362
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
363
+ # encountered while polling for a resource that is not expected.
362
364
  #
363
365
  # @raise [NotImplementedError] Raised when the resource does not
364
366
  #
@@ -144,7 +144,8 @@ module Aws::AutoScaling
144
144
  # Waiter polls an API operation until a resource enters a desired
145
145
  # state.
146
146
  #
147
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
147
+ # @note The waiting operation is performed on a copy. The original resource
148
+ # remains unchanged.
148
149
  #
149
150
  # ## Basic Usage
150
151
  #
@@ -157,13 +158,15 @@ module Aws::AutoScaling
157
158
  #
158
159
  # ## Example
159
160
  #
160
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
161
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
162
+ # instance.state.name == 'running'
163
+ # end
161
164
  #
162
165
  # ## Configuration
163
166
  #
164
167
  # You can configure the maximum number of polling attempts, and the
165
- # delay (in seconds) between each polling attempt. The waiting condition is set
166
- # by passing a block to {#wait_until}:
168
+ # delay (in seconds) between each polling attempt. The waiting condition is
169
+ # set by passing a block to {#wait_until}:
167
170
  #
168
171
  # # poll for ~25 seconds
169
172
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -194,17 +197,16 @@ module Aws::AutoScaling
194
197
  # # resource did not enter the desired state in time
195
198
  # end
196
199
  #
200
+ # @yieldparam [Resource] resource to be used in the waiting condition.
197
201
  #
198
- # @yield param [Resource] resource to be used in the waiting condition
199
- #
200
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
201
- # because the waiter has entered a state that it will not transition
202
- # out of, preventing success.
202
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
203
+ # terminates because the waiter has entered a state that it will not
204
+ # transition out of, preventing success.
203
205
  #
204
206
  # yet successful.
205
207
  #
206
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
207
- # while polling for a resource that is not expected.
208
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
209
+ # encountered while polling for a resource that is not expected.
208
210
  #
209
211
  # @raise [NotImplementedError] Raised when the resource does not
210
212
  #
@@ -331,8 +333,8 @@ module Aws::AutoScaling
331
333
  #
332
334
  # If the lifecycle hook times out, Amazon EC2 Auto Scaling performs the
333
335
  # action that you specified in the `DefaultResult` parameter. You can
334
- # prevent the lifecycle hook from timing out by calling
335
- # RecordLifecycleActionHeartbeat.
336
+ # prevent the lifecycle hook from timing out by calling the
337
+ # RecordLifecycleActionHeartbeat API.
336
338
  # @option options [String] :default_result
337
339
  # Defines the action the Auto Scaling group should take when the
338
340
  # lifecycle hook timeout elapses or if an unexpected failure occurs.
@@ -99,7 +99,8 @@ module Aws::AutoScaling
99
99
  # Waiter polls an API operation until a resource enters a desired
100
100
  # state.
101
101
  #
102
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
102
+ # @note The waiting operation is performed on a copy. The original resource
103
+ # remains unchanged.
103
104
  #
104
105
  # ## Basic Usage
105
106
  #
@@ -112,13 +113,15 @@ module Aws::AutoScaling
112
113
  #
113
114
  # ## Example
114
115
  #
115
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
116
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
117
+ # instance.state.name == 'running'
118
+ # end
116
119
  #
117
120
  # ## Configuration
118
121
  #
119
122
  # You can configure the maximum number of polling attempts, and the
120
- # delay (in seconds) between each polling attempt. The waiting condition is set
121
- # by passing a block to {#wait_until}:
123
+ # delay (in seconds) between each polling attempt. The waiting condition is
124
+ # set by passing a block to {#wait_until}:
122
125
  #
123
126
  # # poll for ~25 seconds
124
127
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -149,17 +152,16 @@ module Aws::AutoScaling
149
152
  # # resource did not enter the desired state in time
150
153
  # end
151
154
  #
155
+ # @yieldparam [Resource] resource to be used in the waiting condition.
152
156
  #
153
- # @yield param [Resource] resource to be used in the waiting condition
154
- #
155
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
156
- # because the waiter has entered a state that it will not transition
157
- # out of, preventing success.
157
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
158
+ # terminates because the waiter has entered a state that it will not
159
+ # transition out of, preventing success.
158
160
  #
159
161
  # yet successful.
160
162
  #
161
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
162
- # while polling for a resource that is not expected.
163
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
164
+ # encountered while polling for a resource that is not expected.
163
165
  #
164
166
  # @raise [NotImplementedError] Raised when the resource does not
165
167
  #
@@ -85,7 +85,8 @@ module Aws::AutoScaling
85
85
  # Waiter polls an API operation until a resource enters a desired
86
86
  # state.
87
87
  #
88
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
88
+ # @note The waiting operation is performed on a copy. The original resource
89
+ # remains unchanged.
89
90
  #
90
91
  # ## Basic Usage
91
92
  #
@@ -98,13 +99,15 @@ module Aws::AutoScaling
98
99
  #
99
100
  # ## Example
100
101
  #
101
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
102
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
103
+ # instance.state.name == 'running'
104
+ # end
102
105
  #
103
106
  # ## Configuration
104
107
  #
105
108
  # You can configure the maximum number of polling attempts, and the
106
- # delay (in seconds) between each polling attempt. The waiting condition is set
107
- # by passing a block to {#wait_until}:
109
+ # delay (in seconds) between each polling attempt. The waiting condition is
110
+ # set by passing a block to {#wait_until}:
108
111
  #
109
112
  # # poll for ~25 seconds
110
113
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -135,17 +138,16 @@ module Aws::AutoScaling
135
138
  # # resource did not enter the desired state in time
136
139
  # end
137
140
  #
141
+ # @yieldparam [Resource] resource to be used in the waiting condition.
138
142
  #
139
- # @yield param [Resource] resource to be used in the waiting condition
140
- #
141
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
142
- # because the waiter has entered a state that it will not transition
143
- # out of, preventing success.
143
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
144
+ # terminates because the waiter has entered a state that it will not
145
+ # transition out of, preventing success.
144
146
  #
145
147
  # yet successful.
146
148
  #
147
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
148
- # while polling for a resource that is not expected.
149
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
150
+ # encountered while polling for a resource that is not expected.
149
151
  #
150
152
  # @raise [NotImplementedError] Raised when the resource does not
151
153
  #
@@ -6,13 +6,18 @@
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
8
  module Aws::AutoScaling
9
+
9
10
  # This class provides a resource oriented interface for AutoScaling.
10
11
  # To create a resource object:
12
+ #
11
13
  # resource = Aws::AutoScaling::Resource.new(region: 'us-west-2')
14
+ #
12
15
  # You can supply a client object with custom configuration that will be used for all resource operations.
13
- # If you do not pass +:client+, a default client will be constructed.
16
+ # If you do not pass `:client`, a default client will be constructed.
17
+ #
14
18
  # client = Aws::AutoScaling::Client.new(region: 'us-west-2')
15
19
  # resource = Aws::AutoScaling::Resource.new(client: client)
20
+ #
16
21
  class Resource
17
22
 
18
23
  # @param options ({})
@@ -103,19 +108,26 @@ module Aws::AutoScaling
103
108
  # The name of the Auto Scaling group. This name must be unique per
104
109
  # Region per account.
105
110
  # @option options [String] :launch_configuration_name
106
- # The name of the launch configuration.
111
+ # The name of the launch configuration to use when an instance is
112
+ # launched. To get the launch configuration name, use the
113
+ # DescribeLaunchConfigurations API operation. New launch configurations
114
+ # can be created with the CreateLaunchConfiguration API.
107
115
  #
108
- # If you do not specify `LaunchConfigurationName`, you must specify one
109
- # of the following parameters: `InstanceId`, `LaunchTemplate`, or
116
+ # You must specify one of the following parameters in your request:
117
+ # `LaunchConfigurationName`, `LaunchTemplate`, `InstanceId`, or
110
118
  # `MixedInstancesPolicy`.
111
119
  # @option options [Types::LaunchTemplateSpecification] :launch_template
112
- # The launch template to use to launch instances.
120
+ # Parameters used to specify the launch template and version to use when
121
+ # an instance is launched.
113
122
  #
114
123
  # For more information, see [LaunchTemplateSpecification][1] in the
115
124
  # *Amazon EC2 Auto Scaling API Reference*.
116
125
  #
117
- # If you do not specify `LaunchTemplate`, you must specify one of the
118
- # following parameters: `InstanceId`, `LaunchConfigurationName`, or
126
+ # You can alternatively associate a launch template to the Auto Scaling
127
+ # group by using the `MixedInstancesPolicy` parameter.
128
+ #
129
+ # You must specify one of the following parameters in your request:
130
+ # `LaunchConfigurationName`, `LaunchTemplate`, `InstanceId`, or
119
131
  # `MixedInstancesPolicy`.
120
132
  #
121
133
  #
@@ -148,33 +160,43 @@ module Aws::AutoScaling
148
160
  # [2]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html
149
161
  # @option options [String] :instance_id
150
162
  # The ID of the instance used to create a launch configuration for the
151
- # group.
163
+ # group. To get the instance ID, use the Amazon EC2
164
+ # [DescribeInstances][1] API operation.
152
165
  #
153
166
  # When you specify an ID of an instance, Amazon EC2 Auto Scaling creates
154
167
  # a new launch configuration and associates it with the group. This
155
168
  # launch configuration derives its attributes from the specified
156
169
  # instance, except for the block device mapping.
157
170
  #
158
- # For more information, see [Create an Auto Scaling Group Using an EC2
159
- # Instance][1] in the *Amazon EC2 Auto Scaling User Guide*.
160
- #
161
171
  # You must specify one of the following parameters in your request:
162
172
  # `LaunchConfigurationName`, `LaunchTemplate`, `InstanceId`, or
163
173
  # `MixedInstancesPolicy`.
164
174
  #
165
175
  #
166
176
  #
167
- # [1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-from-instance.html
177
+ # [1]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html
168
178
  # @option options [required, Integer] :min_size
169
179
  # The minimum size of the group.
170
180
  # @option options [required, Integer] :max_size
171
181
  # The maximum size of the group.
182
+ #
183
+ # <note markdown="1"> With a mixed instances policy that uses instance weighting, Amazon EC2
184
+ # Auto Scaling may need to go above `MaxSize` to meet your capacity
185
+ # requirements. In this event, Amazon EC2 Auto Scaling will never go
186
+ # above `MaxSize` by more than your maximum instance weight (weights
187
+ # that define how many capacity units each instance contributes to the
188
+ # capacity of the group).
189
+ #
190
+ # </note>
172
191
  # @option options [Integer] :desired_capacity
173
- # The number of Amazon EC2 instances that the Auto Scaling group
174
- # attempts to maintain. This number must be greater than or equal to the
175
- # minimum size of the group and less than or equal to the maximum size
176
- # of the group. If you do not specify a desired capacity, the default is
177
- # the minimum size of the group.
192
+ # The desired capacity is the initial capacity of the Auto Scaling group
193
+ # at the time of its creation and the capacity it attempts to maintain.
194
+ # It can scale beyond this capacity if you configure automatic scaling.
195
+ #
196
+ # This number must be greater than or equal to the minimum size of the
197
+ # group and less than or equal to the maximum size of the group. If you
198
+ # do not specify a desired capacity, the default is the minimum size of
199
+ # the group.
178
200
  # @option options [Integer] :default_cooldown
179
201
  # The amount of time, in seconds, after a scaling activity completes
180
202
  # before another scaling activity can start. The default value is `300`.
@@ -288,7 +310,15 @@ module Aws::AutoScaling
288
310
  # @option options [Array<Types::LifecycleHookSpecification>] :lifecycle_hook_specification_list
289
311
  # One or more lifecycle hooks.
290
312
  # @option options [Array<Types::Tag>] :tags
291
- # One or more tags.
313
+ # One or more tags. You can tag your Auto Scaling group and propagate
314
+ # the tags to the Amazon EC2 instances it launches.
315
+ #
316
+ # Tags are not propagated to Amazon EBS volumes. To add tags to Amazon
317
+ # EBS volumes, specify the tags in a launch template but use caution. If
318
+ # the launch template specifies an instance tag with a key that is also
319
+ # specified for the Auto Scaling group, Amazon EC2 Auto Scaling
320
+ # overrides the value of that instance tag with the value specified by
321
+ # the Auto Scaling group.
292
322
  #
293
323
  # For more information, see [Tagging Auto Scaling Groups and
294
324
  # Instances][1] in the *Amazon EC2 Auto Scaling User Guide*.
@@ -309,20 +339,24 @@ module Aws::AutoScaling
309
339
  # [1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html
310
340
  # @option options [Integer] :max_instance_lifetime
311
341
  # The maximum amount of time, in seconds, that an instance can be in
312
- # service.
342
+ # service. The default is null.
343
+ #
344
+ # This parameter is optional, but if you specify a value for it, you
345
+ # must specify a value of at least 604,800 seconds (7 days). To clear a
346
+ # previously set value, specify a new value of 0.
313
347
  #
314
348
  # For more information, see [Replacing Auto Scaling Instances Based on
315
349
  # Maximum Instance Lifetime][1] in the *Amazon EC2 Auto Scaling User
316
350
  # Guide*.
317
351
  #
318
- # Valid Range: Minimum value of 604800.
352
+ # Valid Range: Minimum value of 0.
319
353
  #
320
354
  #
321
355
  #
322
356
  # [1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html
323
357
  # @return [AutoScalingGroup]
324
358
  def create_group(options = {})
325
- resp = @client.create_auto_scaling_group(options)
359
+ @client.create_auto_scaling_group(options)
326
360
  AutoScalingGroup.new(
327
361
  name: options[:auto_scaling_group_name],
328
362
  client: @client
@@ -584,7 +618,7 @@ module Aws::AutoScaling
584
618
  # [1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-vpc-tenancy
585
619
  # @return [LaunchConfiguration]
586
620
  def create_launch_configuration(options = {})
587
- resp = @client.create_launch_configuration(options)
621
+ @client.create_launch_configuration(options)
588
622
  LaunchConfiguration.new(
589
623
  name: options[:launch_configuration_name],
590
624
  client: @client
@@ -171,7 +171,8 @@ module Aws::AutoScaling
171
171
  # Waiter polls an API operation until a resource enters a desired
172
172
  # state.
173
173
  #
174
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
174
+ # @note The waiting operation is performed on a copy. The original resource
175
+ # remains unchanged.
175
176
  #
176
177
  # ## Basic Usage
177
178
  #
@@ -184,13 +185,15 @@ module Aws::AutoScaling
184
185
  #
185
186
  # ## Example
186
187
  #
187
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
188
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
189
+ # instance.state.name == 'running'
190
+ # end
188
191
  #
189
192
  # ## Configuration
190
193
  #
191
194
  # You can configure the maximum number of polling attempts, and the
192
- # delay (in seconds) between each polling attempt. The waiting condition is set
193
- # by passing a block to {#wait_until}:
195
+ # delay (in seconds) between each polling attempt. The waiting condition is
196
+ # set by passing a block to {#wait_until}:
194
197
  #
195
198
  # # poll for ~25 seconds
196
199
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -221,17 +224,16 @@ module Aws::AutoScaling
221
224
  # # resource did not enter the desired state in time
222
225
  # end
223
226
  #
227
+ # @yieldparam [Resource] resource to be used in the waiting condition.
224
228
  #
225
- # @yield param [Resource] resource to be used in the waiting condition
226
- #
227
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
228
- # because the waiter has entered a state that it will not transition
229
- # out of, preventing success.
229
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
230
+ # terminates because the waiter has entered a state that it will not
231
+ # transition out of, preventing success.
230
232
  #
231
233
  # yet successful.
232
234
  #
233
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
234
- # while polling for a resource that is not expected.
235
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
236
+ # encountered while polling for a resource that is not expected.
235
237
  #
236
238
  # @raise [NotImplementedError] Raised when the resource does not
237
239
  #