aws-sdk-autoscaling 1.32.0 → 1.37.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/aws-sdk-autoscaling.rb +7 -4
- data/lib/aws-sdk-autoscaling/activity.rb +14 -11
- data/lib/aws-sdk-autoscaling/auto_scaling_group.rb +101 -49
- data/lib/aws-sdk-autoscaling/client.rb +328 -131
- data/lib/aws-sdk-autoscaling/errors.rb +29 -7
- data/lib/aws-sdk-autoscaling/instance.rb +20 -12
- data/lib/aws-sdk-autoscaling/launch_configuration.rb +14 -11
- data/lib/aws-sdk-autoscaling/lifecycle_hook.rb +16 -13
- data/lib/aws-sdk-autoscaling/load_balancer.rb +14 -11
- data/lib/aws-sdk-autoscaling/notification_configuration.rb +14 -11
- data/lib/aws-sdk-autoscaling/resource.rb +62 -21
- data/lib/aws-sdk-autoscaling/scaling_policy.rb +14 -11
- data/lib/aws-sdk-autoscaling/scheduled_action.rb +19 -14
- data/lib/aws-sdk-autoscaling/tag.rb +14 -11
- data/lib/aws-sdk-autoscaling/types.rb +264 -109
- data/lib/aws-sdk-autoscaling/waiters.rb +63 -0
- metadata +3 -3
@@ -6,6 +6,35 @@
|
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
8
|
module Aws::AutoScaling
|
9
|
+
|
10
|
+
# When AutoScaling returns an error response, the Ruby SDK constructs and raises an error.
|
11
|
+
# These errors all extend Aws::AutoScaling::Errors::ServiceError < {Aws::Errors::ServiceError}
|
12
|
+
#
|
13
|
+
# You can rescue all AutoScaling errors using ServiceError:
|
14
|
+
#
|
15
|
+
# begin
|
16
|
+
# # do stuff
|
17
|
+
# rescue Aws::AutoScaling::Errors::ServiceError
|
18
|
+
# # rescues all AutoScaling API errors
|
19
|
+
# end
|
20
|
+
#
|
21
|
+
#
|
22
|
+
# ## Request Context
|
23
|
+
# ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
|
24
|
+
# information about the request that generated the error.
|
25
|
+
# See {Seahorse::Client::RequestContext} for more information.
|
26
|
+
#
|
27
|
+
# ## Error Classes
|
28
|
+
# * {AlreadyExistsFault}
|
29
|
+
# * {InvalidNextToken}
|
30
|
+
# * {LimitExceededFault}
|
31
|
+
# * {ResourceContentionFault}
|
32
|
+
# * {ResourceInUseFault}
|
33
|
+
# * {ScalingActivityInProgressFault}
|
34
|
+
# * {ServiceLinkedRoleFailure}
|
35
|
+
#
|
36
|
+
# Additionally, error classes are dynamically generated for service errors based on the error code
|
37
|
+
# if they are not defined above.
|
9
38
|
module Errors
|
10
39
|
|
11
40
|
extend Aws::Errors::DynamicErrors
|
@@ -23,7 +52,6 @@ module Aws::AutoScaling
|
|
23
52
|
def message
|
24
53
|
@message || @data[:message]
|
25
54
|
end
|
26
|
-
|
27
55
|
end
|
28
56
|
|
29
57
|
class InvalidNextToken < ServiceError
|
@@ -39,7 +67,6 @@ module Aws::AutoScaling
|
|
39
67
|
def message
|
40
68
|
@message || @data[:message]
|
41
69
|
end
|
42
|
-
|
43
70
|
end
|
44
71
|
|
45
72
|
class LimitExceededFault < ServiceError
|
@@ -55,7 +82,6 @@ module Aws::AutoScaling
|
|
55
82
|
def message
|
56
83
|
@message || @data[:message]
|
57
84
|
end
|
58
|
-
|
59
85
|
end
|
60
86
|
|
61
87
|
class ResourceContentionFault < ServiceError
|
@@ -71,7 +97,6 @@ module Aws::AutoScaling
|
|
71
97
|
def message
|
72
98
|
@message || @data[:message]
|
73
99
|
end
|
74
|
-
|
75
100
|
end
|
76
101
|
|
77
102
|
class ResourceInUseFault < ServiceError
|
@@ -87,7 +112,6 @@ module Aws::AutoScaling
|
|
87
112
|
def message
|
88
113
|
@message || @data[:message]
|
89
114
|
end
|
90
|
-
|
91
115
|
end
|
92
116
|
|
93
117
|
class ScalingActivityInProgressFault < ServiceError
|
@@ -103,7 +127,6 @@ module Aws::AutoScaling
|
|
103
127
|
def message
|
104
128
|
@message || @data[:message]
|
105
129
|
end
|
106
|
-
|
107
130
|
end
|
108
131
|
|
109
132
|
class ServiceLinkedRoleFailure < ServiceError
|
@@ -119,7 +142,6 @@ module Aws::AutoScaling
|
|
119
142
|
def message
|
120
143
|
@message || @data[:message]
|
121
144
|
end
|
122
|
-
|
123
145
|
end
|
124
146
|
|
125
147
|
end
|
@@ -6,6 +6,7 @@
|
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
8
|
module Aws::AutoScaling
|
9
|
+
|
9
10
|
class Instance
|
10
11
|
|
11
12
|
extend Aws::Deprecations
|
@@ -137,7 +138,8 @@ module Aws::AutoScaling
|
|
137
138
|
# Waiter polls an API operation until a resource enters a desired
|
138
139
|
# state.
|
139
140
|
#
|
140
|
-
# @note The waiting operation is performed on a copy. The original resource
|
141
|
+
# @note The waiting operation is performed on a copy. The original resource
|
142
|
+
# remains unchanged.
|
141
143
|
#
|
142
144
|
# ## Basic Usage
|
143
145
|
#
|
@@ -150,13 +152,15 @@ module Aws::AutoScaling
|
|
150
152
|
#
|
151
153
|
# ## Example
|
152
154
|
#
|
153
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
155
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
156
|
+
# instance.state.name == 'running'
|
157
|
+
# end
|
154
158
|
#
|
155
159
|
# ## Configuration
|
156
160
|
#
|
157
161
|
# You can configure the maximum number of polling attempts, and the
|
158
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
159
|
-
# 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}:
|
160
164
|
#
|
161
165
|
# # poll for ~25 seconds
|
162
166
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -187,17 +191,16 @@ module Aws::AutoScaling
|
|
187
191
|
# # resource did not enter the desired state in time
|
188
192
|
# end
|
189
193
|
#
|
194
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
190
195
|
#
|
191
|
-
# @
|
192
|
-
#
|
193
|
-
#
|
194
|
-
# because the waiter has entered a state that it will not transition
|
195
|
-
# 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.
|
196
199
|
#
|
197
200
|
# yet successful.
|
198
201
|
#
|
199
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
200
|
-
# 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.
|
201
204
|
#
|
202
205
|
# @raise [NotImplementedError] Raised when the resource does not
|
203
206
|
#
|
@@ -338,7 +341,12 @@ module Aws::AutoScaling
|
|
338
341
|
# not respect the grace period associated with the group.
|
339
342
|
#
|
340
343
|
# For more information about the health check grace period, see
|
341
|
-
# 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
|
342
350
|
# @return [EmptyStructure]
|
343
351
|
def set_health(options = {})
|
344
352
|
options = options.merge(instance_id: @id)
|
@@ -6,6 +6,7 @@
|
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
8
|
module Aws::AutoScaling
|
9
|
+
|
9
10
|
class LaunchConfiguration
|
10
11
|
|
11
12
|
extend Aws::Deprecations
|
@@ -297,7 +298,8 @@ module Aws::AutoScaling
|
|
297
298
|
# Waiter polls an API operation until a resource enters a desired
|
298
299
|
# state.
|
299
300
|
#
|
300
|
-
# @note The waiting operation is performed on a copy. The original resource
|
301
|
+
# @note The waiting operation is performed on a copy. The original resource
|
302
|
+
# remains unchanged.
|
301
303
|
#
|
302
304
|
# ## Basic Usage
|
303
305
|
#
|
@@ -310,13 +312,15 @@ module Aws::AutoScaling
|
|
310
312
|
#
|
311
313
|
# ## Example
|
312
314
|
#
|
313
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
315
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
316
|
+
# instance.state.name == 'running'
|
317
|
+
# end
|
314
318
|
#
|
315
319
|
# ## Configuration
|
316
320
|
#
|
317
321
|
# You can configure the maximum number of polling attempts, and the
|
318
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
319
|
-
# 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}:
|
320
324
|
#
|
321
325
|
# # poll for ~25 seconds
|
322
326
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -347,17 +351,16 @@ module Aws::AutoScaling
|
|
347
351
|
# # resource did not enter the desired state in time
|
348
352
|
# end
|
349
353
|
#
|
354
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
350
355
|
#
|
351
|
-
# @
|
352
|
-
#
|
353
|
-
#
|
354
|
-
# because the waiter has entered a state that it will not transition
|
355
|
-
# 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.
|
356
359
|
#
|
357
360
|
# yet successful.
|
358
361
|
#
|
359
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
360
|
-
# 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.
|
361
364
|
#
|
362
365
|
# @raise [NotImplementedError] Raised when the resource does not
|
363
366
|
#
|
@@ -6,6 +6,7 @@
|
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
8
|
module Aws::AutoScaling
|
9
|
+
|
9
10
|
class LifecycleHook
|
10
11
|
|
11
12
|
extend Aws::Deprecations
|
@@ -143,7 +144,8 @@ module Aws::AutoScaling
|
|
143
144
|
# Waiter polls an API operation until a resource enters a desired
|
144
145
|
# state.
|
145
146
|
#
|
146
|
-
# @note The waiting operation is performed on a copy. The original resource
|
147
|
+
# @note The waiting operation is performed on a copy. The original resource
|
148
|
+
# remains unchanged.
|
147
149
|
#
|
148
150
|
# ## Basic Usage
|
149
151
|
#
|
@@ -156,13 +158,15 @@ module Aws::AutoScaling
|
|
156
158
|
#
|
157
159
|
# ## Example
|
158
160
|
#
|
159
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
161
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
162
|
+
# instance.state.name == 'running'
|
163
|
+
# end
|
160
164
|
#
|
161
165
|
# ## Configuration
|
162
166
|
#
|
163
167
|
# You can configure the maximum number of polling attempts, and the
|
164
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
165
|
-
# 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}:
|
166
170
|
#
|
167
171
|
# # poll for ~25 seconds
|
168
172
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -193,17 +197,16 @@ module Aws::AutoScaling
|
|
193
197
|
# # resource did not enter the desired state in time
|
194
198
|
# end
|
195
199
|
#
|
200
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
196
201
|
#
|
197
|
-
# @
|
198
|
-
#
|
199
|
-
#
|
200
|
-
# because the waiter has entered a state that it will not transition
|
201
|
-
# 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.
|
202
205
|
#
|
203
206
|
# yet successful.
|
204
207
|
#
|
205
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
206
|
-
# 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.
|
207
210
|
#
|
208
211
|
# @raise [NotImplementedError] Raised when the resource does not
|
209
212
|
#
|
@@ -330,8 +333,8 @@ module Aws::AutoScaling
|
|
330
333
|
#
|
331
334
|
# If the lifecycle hook times out, Amazon EC2 Auto Scaling performs the
|
332
335
|
# action that you specified in the `DefaultResult` parameter. You can
|
333
|
-
# prevent the lifecycle hook from timing out by calling
|
334
|
-
# RecordLifecycleActionHeartbeat.
|
336
|
+
# prevent the lifecycle hook from timing out by calling the
|
337
|
+
# RecordLifecycleActionHeartbeat API.
|
335
338
|
# @option options [String] :default_result
|
336
339
|
# Defines the action the Auto Scaling group should take when the
|
337
340
|
# lifecycle hook timeout elapses or if an unexpected failure occurs.
|
@@ -6,6 +6,7 @@
|
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
8
|
module Aws::AutoScaling
|
9
|
+
|
9
10
|
class LoadBalancer
|
10
11
|
|
11
12
|
extend Aws::Deprecations
|
@@ -98,7 +99,8 @@ module Aws::AutoScaling
|
|
98
99
|
# Waiter polls an API operation until a resource enters a desired
|
99
100
|
# state.
|
100
101
|
#
|
101
|
-
# @note The waiting operation is performed on a copy. The original resource
|
102
|
+
# @note The waiting operation is performed on a copy. The original resource
|
103
|
+
# remains unchanged.
|
102
104
|
#
|
103
105
|
# ## Basic Usage
|
104
106
|
#
|
@@ -111,13 +113,15 @@ module Aws::AutoScaling
|
|
111
113
|
#
|
112
114
|
# ## Example
|
113
115
|
#
|
114
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
116
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
117
|
+
# instance.state.name == 'running'
|
118
|
+
# end
|
115
119
|
#
|
116
120
|
# ## Configuration
|
117
121
|
#
|
118
122
|
# You can configure the maximum number of polling attempts, and the
|
119
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
120
|
-
# 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}:
|
121
125
|
#
|
122
126
|
# # poll for ~25 seconds
|
123
127
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -148,17 +152,16 @@ module Aws::AutoScaling
|
|
148
152
|
# # resource did not enter the desired state in time
|
149
153
|
# end
|
150
154
|
#
|
155
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
151
156
|
#
|
152
|
-
# @
|
153
|
-
#
|
154
|
-
#
|
155
|
-
# because the waiter has entered a state that it will not transition
|
156
|
-
# 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.
|
157
160
|
#
|
158
161
|
# yet successful.
|
159
162
|
#
|
160
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
161
|
-
# 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.
|
162
165
|
#
|
163
166
|
# @raise [NotImplementedError] Raised when the resource does not
|
164
167
|
#
|
@@ -6,6 +6,7 @@
|
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
8
|
module Aws::AutoScaling
|
9
|
+
|
9
10
|
class NotificationConfiguration
|
10
11
|
|
11
12
|
extend Aws::Deprecations
|
@@ -84,7 +85,8 @@ module Aws::AutoScaling
|
|
84
85
|
# Waiter polls an API operation until a resource enters a desired
|
85
86
|
# state.
|
86
87
|
#
|
87
|
-
# @note The waiting operation is performed on a copy. The original resource
|
88
|
+
# @note The waiting operation is performed on a copy. The original resource
|
89
|
+
# remains unchanged.
|
88
90
|
#
|
89
91
|
# ## Basic Usage
|
90
92
|
#
|
@@ -97,13 +99,15 @@ module Aws::AutoScaling
|
|
97
99
|
#
|
98
100
|
# ## Example
|
99
101
|
#
|
100
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
102
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
103
|
+
# instance.state.name == 'running'
|
104
|
+
# end
|
101
105
|
#
|
102
106
|
# ## Configuration
|
103
107
|
#
|
104
108
|
# You can configure the maximum number of polling attempts, and the
|
105
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
106
|
-
# 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}:
|
107
111
|
#
|
108
112
|
# # poll for ~25 seconds
|
109
113
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -134,17 +138,16 @@ module Aws::AutoScaling
|
|
134
138
|
# # resource did not enter the desired state in time
|
135
139
|
# end
|
136
140
|
#
|
141
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
137
142
|
#
|
138
|
-
# @
|
139
|
-
#
|
140
|
-
#
|
141
|
-
# because the waiter has entered a state that it will not transition
|
142
|
-
# 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.
|
143
146
|
#
|
144
147
|
# yet successful.
|
145
148
|
#
|
146
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
147
|
-
# 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.
|
148
151
|
#
|
149
152
|
# @raise [NotImplementedError] Raised when the resource does not
|
150
153
|
#
|
@@ -6,6 +6,18 @@
|
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
8
|
module Aws::AutoScaling
|
9
|
+
|
10
|
+
# This class provides a resource oriented interface for AutoScaling.
|
11
|
+
# To create a resource object:
|
12
|
+
#
|
13
|
+
# resource = Aws::AutoScaling::Resource.new(region: 'us-west-2')
|
14
|
+
#
|
15
|
+
# You can supply a client object with custom configuration that will be used for all resource operations.
|
16
|
+
# If you do not pass `:client`, a default client will be constructed.
|
17
|
+
#
|
18
|
+
# client = Aws::AutoScaling::Client.new(region: 'us-west-2')
|
19
|
+
# resource = Aws::AutoScaling::Resource.new(client: client)
|
20
|
+
#
|
9
21
|
class Resource
|
10
22
|
|
11
23
|
# @param options ({})
|
@@ -96,19 +108,26 @@ module Aws::AutoScaling
|
|
96
108
|
# The name of the Auto Scaling group. This name must be unique per
|
97
109
|
# Region per account.
|
98
110
|
# @option options [String] :launch_configuration_name
|
99
|
-
# 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.
|
100
115
|
#
|
101
|
-
#
|
102
|
-
#
|
116
|
+
# You must specify one of the following parameters in your request:
|
117
|
+
# `LaunchConfigurationName`, `LaunchTemplate`, `InstanceId`, or
|
103
118
|
# `MixedInstancesPolicy`.
|
104
119
|
# @option options [Types::LaunchTemplateSpecification] :launch_template
|
105
|
-
#
|
120
|
+
# Parameters used to specify the launch template and version to use when
|
121
|
+
# an instance is launched.
|
106
122
|
#
|
107
123
|
# For more information, see [LaunchTemplateSpecification][1] in the
|
108
124
|
# *Amazon EC2 Auto Scaling API Reference*.
|
109
125
|
#
|
110
|
-
#
|
111
|
-
#
|
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
|
112
131
|
# `MixedInstancesPolicy`.
|
113
132
|
#
|
114
133
|
#
|
@@ -141,33 +160,43 @@ module Aws::AutoScaling
|
|
141
160
|
# [2]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html
|
142
161
|
# @option options [String] :instance_id
|
143
162
|
# The ID of the instance used to create a launch configuration for the
|
144
|
-
# group.
|
163
|
+
# group. To get the instance ID, use the Amazon EC2
|
164
|
+
# [DescribeInstances][1] API operation.
|
145
165
|
#
|
146
166
|
# When you specify an ID of an instance, Amazon EC2 Auto Scaling creates
|
147
167
|
# a new launch configuration and associates it with the group. This
|
148
168
|
# launch configuration derives its attributes from the specified
|
149
169
|
# instance, except for the block device mapping.
|
150
170
|
#
|
151
|
-
# For more information, see [Create an Auto Scaling Group Using an EC2
|
152
|
-
# Instance][1] in the *Amazon EC2 Auto Scaling User Guide*.
|
153
|
-
#
|
154
171
|
# You must specify one of the following parameters in your request:
|
155
172
|
# `LaunchConfigurationName`, `LaunchTemplate`, `InstanceId`, or
|
156
173
|
# `MixedInstancesPolicy`.
|
157
174
|
#
|
158
175
|
#
|
159
176
|
#
|
160
|
-
# [1]: https://docs.aws.amazon.com/
|
177
|
+
# [1]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html
|
161
178
|
# @option options [required, Integer] :min_size
|
162
179
|
# The minimum size of the group.
|
163
180
|
# @option options [required, Integer] :max_size
|
164
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>
|
165
191
|
# @option options [Integer] :desired_capacity
|
166
|
-
# The
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
# the minimum size of the
|
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.
|
171
200
|
# @option options [Integer] :default_cooldown
|
172
201
|
# The amount of time, in seconds, after a scaling activity completes
|
173
202
|
# before another scaling activity can start. The default value is `300`.
|
@@ -281,7 +310,15 @@ module Aws::AutoScaling
|
|
281
310
|
# @option options [Array<Types::LifecycleHookSpecification>] :lifecycle_hook_specification_list
|
282
311
|
# One or more lifecycle hooks.
|
283
312
|
# @option options [Array<Types::Tag>] :tags
|
284
|
-
# 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.
|
285
322
|
#
|
286
323
|
# For more information, see [Tagging Auto Scaling Groups and
|
287
324
|
# Instances][1] in the *Amazon EC2 Auto Scaling User Guide*.
|
@@ -302,20 +339,24 @@ module Aws::AutoScaling
|
|
302
339
|
# [1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html
|
303
340
|
# @option options [Integer] :max_instance_lifetime
|
304
341
|
# The maximum amount of time, in seconds, that an instance can be in
|
305
|
-
# 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.
|
306
347
|
#
|
307
348
|
# For more information, see [Replacing Auto Scaling Instances Based on
|
308
349
|
# Maximum Instance Lifetime][1] in the *Amazon EC2 Auto Scaling User
|
309
350
|
# Guide*.
|
310
351
|
#
|
311
|
-
# Valid Range: Minimum value of
|
352
|
+
# Valid Range: Minimum value of 0.
|
312
353
|
#
|
313
354
|
#
|
314
355
|
#
|
315
356
|
# [1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html
|
316
357
|
# @return [AutoScalingGroup]
|
317
358
|
def create_group(options = {})
|
318
|
-
|
359
|
+
@client.create_auto_scaling_group(options)
|
319
360
|
AutoScalingGroup.new(
|
320
361
|
name: options[:auto_scaling_group_name],
|
321
362
|
client: @client
|
@@ -577,7 +618,7 @@ module Aws::AutoScaling
|
|
577
618
|
# [1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-vpc-tenancy
|
578
619
|
# @return [LaunchConfiguration]
|
579
620
|
def create_launch_configuration(options = {})
|
580
|
-
|
621
|
+
@client.create_launch_configuration(options)
|
581
622
|
LaunchConfiguration.new(
|
582
623
|
name: options[:launch_configuration_name],
|
583
624
|
client: @client
|