aws-sdk-autoscaling 1.0.0.rc1 → 1.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-autoscaling.rb +2 -2
- data/lib/aws-sdk-autoscaling/activity.rb +131 -133
- data/lib/aws-sdk-autoscaling/auto_scaling_group.rb +940 -942
- data/lib/aws-sdk-autoscaling/client.rb +3146 -2674
- data/lib/aws-sdk-autoscaling/client_api.rb +1403 -1405
- data/lib/aws-sdk-autoscaling/errors.rb +4 -13
- data/lib/aws-sdk-autoscaling/instance.rb +351 -359
- data/lib/aws-sdk-autoscaling/launch_configuration.rb +198 -200
- data/lib/aws-sdk-autoscaling/lifecycle_hook.rb +288 -290
- data/lib/aws-sdk-autoscaling/load_balancer.rb +179 -187
- data/lib/aws-sdk-autoscaling/notification_configuration.rb +162 -167
- data/lib/aws-sdk-autoscaling/resource.rb +645 -647
- data/lib/aws-sdk-autoscaling/scaling_policy.rb +216 -218
- data/lib/aws-sdk-autoscaling/scheduled_action.rb +152 -154
- data/lib/aws-sdk-autoscaling/tag.rb +216 -224
- data/lib/aws-sdk-autoscaling/types.rb +3987 -3547
- data/lib/aws-sdk-autoscaling/waiters.rb +126 -127
- metadata +2 -2
@@ -1,236 +1,234 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
8
|
+
module Aws::AutoScaling
|
9
|
+
class LaunchConfiguration
|
10
|
+
|
11
|
+
extend Aws::Deprecations
|
12
|
+
|
13
|
+
# @overload def initialize(name, options = {})
|
14
|
+
# @param [String] name
|
15
|
+
# @option options [Client] :client
|
16
|
+
# @overload def initialize(options = {})
|
17
|
+
# @option options [required, String] :name
|
18
|
+
# @option options [Client] :client
|
19
|
+
def initialize(*args)
|
20
|
+
options = Hash === args.last ? args.pop.dup : {}
|
21
|
+
@name = extract_name(args, options)
|
22
|
+
@data = options.delete(:data)
|
23
|
+
@client = options.delete(:client) || Client.new(options)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
# @return [String]
|
29
|
+
def name
|
30
|
+
@name
|
31
|
+
end
|
32
|
+
alias :launch_configuration_name :name
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
# The Amazon Resource Name (ARN) of the launch configuration.
|
35
|
+
# @return [String]
|
36
|
+
def launch_configuration_arn
|
37
|
+
data.launch_configuration_arn
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
# The ID of the Amazon Machine Image (AMI).
|
41
|
+
# @return [String]
|
42
|
+
def image_id
|
43
|
+
data.image_id
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
# The name of the key pair.
|
47
|
+
# @return [String]
|
48
|
+
def key_name
|
49
|
+
data.key_name
|
50
|
+
end
|
52
51
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
# The security groups to associate with the instances.
|
53
|
+
# @return [Array<String>]
|
54
|
+
def security_groups
|
55
|
+
data.security_groups
|
56
|
+
end
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
58
|
+
# The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances
|
59
|
+
# to. This parameter can only be used if you are launching EC2-Classic
|
60
|
+
# instances. For more information, see [ClassicLink][1] in the *Amazon
|
61
|
+
# Elastic Compute Cloud User Guide*.
|
62
|
+
#
|
63
|
+
#
|
64
|
+
#
|
65
|
+
# [1]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html
|
66
|
+
# @return [String]
|
67
|
+
def classic_link_vpc_id
|
68
|
+
data.classic_link_vpc_id
|
69
|
+
end
|
71
70
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
71
|
+
# The IDs of one or more security groups for the VPC specified in
|
72
|
+
# `ClassicLinkVPCId`. This parameter is required if you specify a
|
73
|
+
# ClassicLink-enabled VPC, and cannot be used otherwise. For more
|
74
|
+
# information, see [ClassicLink][1] in the *Amazon Elastic Compute Cloud
|
75
|
+
# User Guide*.
|
76
|
+
#
|
77
|
+
#
|
78
|
+
#
|
79
|
+
# [1]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html
|
80
|
+
# @return [Array<String>]
|
81
|
+
def classic_link_vpc_security_groups
|
82
|
+
data.classic_link_vpc_security_groups
|
83
|
+
end
|
85
84
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
85
|
+
# The user data available to the instances.
|
86
|
+
# @return [String]
|
87
|
+
def user_data
|
88
|
+
data.user_data
|
89
|
+
end
|
91
90
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
91
|
+
# The instance type for the instances.
|
92
|
+
# @return [String]
|
93
|
+
def instance_type
|
94
|
+
data.instance_type
|
95
|
+
end
|
97
96
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
97
|
+
# The ID of the kernel associated with the AMI.
|
98
|
+
# @return [String]
|
99
|
+
def kernel_id
|
100
|
+
data.kernel_id
|
101
|
+
end
|
103
102
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
103
|
+
# The ID of the RAM disk associated with the AMI.
|
104
|
+
# @return [String]
|
105
|
+
def ramdisk_id
|
106
|
+
data.ramdisk_id
|
107
|
+
end
|
109
108
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
109
|
+
# A block device mapping, which specifies the block devices for the
|
110
|
+
# instance.
|
111
|
+
# @return [Array<Types::BlockDeviceMapping>]
|
112
|
+
def block_device_mappings
|
113
|
+
data.block_device_mappings
|
114
|
+
end
|
116
115
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
116
|
+
# Controls whether instances in this group are launched with detailed
|
117
|
+
# (`true`) or basic (`false`) monitoring.
|
118
|
+
# @return [Types::InstanceMonitoring]
|
119
|
+
def instance_monitoring
|
120
|
+
data.instance_monitoring
|
121
|
+
end
|
123
122
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
123
|
+
# The price to bid when launching Spot Instances.
|
124
|
+
# @return [String]
|
125
|
+
def spot_price
|
126
|
+
data.spot_price
|
127
|
+
end
|
129
128
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
129
|
+
# The name or Amazon Resource Name (ARN) of the instance profile
|
130
|
+
# associated with the IAM role for the instance.
|
131
|
+
# @return [String]
|
132
|
+
def iam_instance_profile
|
133
|
+
data.iam_instance_profile
|
134
|
+
end
|
136
135
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
136
|
+
# The creation date and time for the launch configuration.
|
137
|
+
# @return [Time]
|
138
|
+
def created_time
|
139
|
+
data.created_time
|
140
|
+
end
|
142
141
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
142
|
+
# Controls whether the instance is optimized for EBS I/O (`true`) or not
|
143
|
+
# (`false`).
|
144
|
+
# @return [Boolean]
|
145
|
+
def ebs_optimized
|
146
|
+
data.ebs_optimized
|
147
|
+
end
|
149
148
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
149
|
+
# \[EC2-VPC\] Indicates whether to assign a public IP address to each
|
150
|
+
# instance.
|
151
|
+
# @return [Boolean]
|
152
|
+
def associate_public_ip_address
|
153
|
+
data.associate_public_ip_address
|
154
|
+
end
|
156
155
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
156
|
+
# The tenancy of the instance, either `default` or `dedicated`. An
|
157
|
+
# instance with `dedicated` tenancy runs in an isolated, single-tenant
|
158
|
+
# hardware and can only be launched into a VPC.
|
159
|
+
# @return [String]
|
160
|
+
def placement_tenancy
|
161
|
+
data.placement_tenancy
|
162
|
+
end
|
164
163
|
|
165
|
-
|
164
|
+
# @!endgroup
|
166
165
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
166
|
+
# @return [Client]
|
167
|
+
def client
|
168
|
+
@client
|
169
|
+
end
|
171
170
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
171
|
+
# Loads, or reloads {#data} for the current {LaunchConfiguration}.
|
172
|
+
# Returns `self` making it possible to chain methods.
|
173
|
+
#
|
174
|
+
# launch_configuration.reload.data
|
175
|
+
#
|
176
|
+
# @return [self]
|
177
|
+
def load
|
178
|
+
resp = @client.describe_launch_configurations(launch_configuration_names: [@name])
|
179
|
+
@data = resp.launchconfigurations[0]
|
180
|
+
self
|
181
|
+
end
|
182
|
+
alias :reload :load
|
183
|
+
|
184
|
+
# @return [Types::LaunchConfiguration]
|
185
|
+
# Returns the data for this {LaunchConfiguration}. Calls
|
186
|
+
# {Client#describe_launch_configurations} if {#data_loaded?} is `false`.
|
187
|
+
def data
|
188
|
+
load unless @data
|
189
|
+
@data
|
190
|
+
end
|
192
191
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
192
|
+
# @return [Boolean]
|
193
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
194
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
195
|
+
def data_loaded?
|
196
|
+
!!@data
|
197
|
+
end
|
199
198
|
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
199
|
+
# @!group Actions
|
200
|
+
|
201
|
+
# @example Request syntax with placeholder values
|
202
|
+
#
|
203
|
+
# launch_configuration.delete()
|
204
|
+
# @param [Hash] options ({})
|
205
|
+
# @return [EmptyStructure]
|
206
|
+
def delete(options = {})
|
207
|
+
options = options.merge(launch_configuration_name: @name)
|
208
|
+
resp = @client.delete_launch_configuration(options)
|
209
|
+
resp.data
|
210
|
+
end
|
212
211
|
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
private
|
221
|
-
|
222
|
-
def extract_name(args, options)
|
223
|
-
value = args[0] || options.delete(:name)
|
224
|
-
case value
|
225
|
-
when String then value
|
226
|
-
when nil then raise ArgumentError, "missing required option :name"
|
227
|
-
else
|
228
|
-
msg = "expected :name to be a String, got #{value.class}"
|
229
|
-
raise ArgumentError, msg
|
230
|
-
end
|
231
|
-
end
|
212
|
+
# @deprecated
|
213
|
+
# @api private
|
214
|
+
def identifiers
|
215
|
+
{ name: @name }
|
216
|
+
end
|
217
|
+
deprecated(:identifiers)
|
232
218
|
|
233
|
-
|
219
|
+
private
|
220
|
+
|
221
|
+
def extract_name(args, options)
|
222
|
+
value = args[0] || options.delete(:name)
|
223
|
+
case value
|
224
|
+
when String then value
|
225
|
+
when nil then raise ArgumentError, "missing required option :name"
|
226
|
+
else
|
227
|
+
msg = "expected :name to be a String, got #{value.class}"
|
228
|
+
raise ArgumentError, msg
|
229
|
+
end
|
234
230
|
end
|
231
|
+
|
232
|
+
class Collection < Aws::Resources::Collection; end
|
235
233
|
end
|
236
234
|
end
|
@@ -1,329 +1,327 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
class LifecycleHook
|
8
|
+
module Aws::AutoScaling
|
9
|
+
class LifecycleHook
|
11
10
|
|
12
|
-
|
11
|
+
extend Aws::Deprecations
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
13
|
+
# @overload def initialize(group_name, name, options = {})
|
14
|
+
# @param [String] group_name
|
15
|
+
# @param [String] name
|
16
|
+
# @option options [Client] :client
|
17
|
+
# @overload def initialize(options = {})
|
18
|
+
# @option options [required, String] :group_name
|
19
|
+
# @option options [required, String] :name
|
20
|
+
# @option options [Client] :client
|
21
|
+
def initialize(*args)
|
22
|
+
options = Hash === args.last ? args.pop.dup : {}
|
23
|
+
@group_name = extract_group_name(args, options)
|
24
|
+
@name = extract_name(args, options)
|
25
|
+
@data = options.delete(:data)
|
26
|
+
@client = options.delete(:client) || Client.new(options)
|
27
|
+
end
|
29
28
|
|
30
|
-
|
29
|
+
# @!group Read-Only Attributes
|
31
30
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
# @return [String]
|
32
|
+
def group_name
|
33
|
+
@group_name
|
34
|
+
end
|
35
|
+
alias :auto_scaling_group_name :group_name
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
# @return [String]
|
38
|
+
def name
|
39
|
+
@name
|
40
|
+
end
|
41
|
+
alias :lifecycle_hook_name :name
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
43
|
+
# The state of the EC2 instance to which you want to attach the
|
44
|
+
# lifecycle hook. For a list of lifecycle hook types, see
|
45
|
+
# DescribeLifecycleHookTypes.
|
46
|
+
# @return [String]
|
47
|
+
def lifecycle_transition
|
48
|
+
data.lifecycle_transition
|
49
|
+
end
|
51
50
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
51
|
+
# The ARN of the notification target that Auto Scaling uses to notify
|
52
|
+
# you when an instance is in the transition state for the lifecycle
|
53
|
+
# hook. This ARN target can be either an SQS queue or an SNS topic. The
|
54
|
+
# notification message sent to the target includes the following:
|
55
|
+
#
|
56
|
+
# * Lifecycle action token
|
57
|
+
#
|
58
|
+
# * User account ID
|
59
|
+
#
|
60
|
+
# * Name of the Auto Scaling group
|
61
|
+
#
|
62
|
+
# * Lifecycle hook name
|
63
|
+
#
|
64
|
+
# * EC2 instance ID
|
65
|
+
#
|
66
|
+
# * Lifecycle transition
|
67
|
+
#
|
68
|
+
# * Notification metadata
|
69
|
+
# @return [String]
|
70
|
+
def notification_target_arn
|
71
|
+
data.notification_target_arn
|
72
|
+
end
|
74
73
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
74
|
+
# The ARN of the IAM role that allows the Auto Scaling group to publish
|
75
|
+
# to the specified notification target.
|
76
|
+
# @return [String]
|
77
|
+
def role_arn
|
78
|
+
data.role_arn
|
79
|
+
end
|
81
80
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
81
|
+
# Additional information that you want to include any time Auto Scaling
|
82
|
+
# sends a message to the notification target.
|
83
|
+
# @return [String]
|
84
|
+
def notification_metadata
|
85
|
+
data.notification_metadata
|
86
|
+
end
|
88
87
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
88
|
+
# The maximum time, in seconds, that can elapse before the lifecycle
|
89
|
+
# hook times out. The default is 3600 seconds (1 hour). When the
|
90
|
+
# lifecycle hook times out, Auto Scaling performs the default action.
|
91
|
+
# You can prevent the lifecycle hook from timing out by calling
|
92
|
+
# RecordLifecycleActionHeartbeat.
|
93
|
+
# @return [Integer]
|
94
|
+
def heartbeat_timeout
|
95
|
+
data.heartbeat_timeout
|
96
|
+
end
|
98
97
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
98
|
+
# The maximum time, in seconds, that an instance can remain in a
|
99
|
+
# `Pending:Wait` or `Terminating:Wait` state. The maximum is 172800
|
100
|
+
# seconds (48 hours) or 100 times `HeartbeatTimeout`, whichever is
|
101
|
+
# smaller.
|
102
|
+
# @return [Integer]
|
103
|
+
def global_timeout
|
104
|
+
data.global_timeout
|
105
|
+
end
|
107
106
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
107
|
+
# Defines the action the Auto Scaling group should take when the
|
108
|
+
# lifecycle hook timeout elapses or if an unexpected failure occurs. The
|
109
|
+
# valid values are `CONTINUE` and `ABANDON`. The default value is
|
110
|
+
# `CONTINUE`.
|
111
|
+
# @return [String]
|
112
|
+
def default_result
|
113
|
+
data.default_result
|
114
|
+
end
|
116
115
|
|
117
|
-
|
116
|
+
# @!endgroup
|
118
117
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
118
|
+
# @return [Client]
|
119
|
+
def client
|
120
|
+
@client
|
121
|
+
end
|
123
122
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
123
|
+
# Loads, or reloads {#data} for the current {LifecycleHook}.
|
124
|
+
# Returns `self` making it possible to chain methods.
|
125
|
+
#
|
126
|
+
# lifecycle_hook.reload.data
|
127
|
+
#
|
128
|
+
# @return [self]
|
129
|
+
def load
|
130
|
+
resp = @client.describe_lifecycle_hooks(
|
131
|
+
auto_scaling_group_name: @group_name,
|
132
|
+
lifecycle_hook_names: [@name]
|
133
|
+
)
|
134
|
+
@data = resp.lifecyclehooks[0]
|
135
|
+
self
|
136
|
+
end
|
137
|
+
alias :reload :load
|
139
138
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
139
|
+
# @return [Types::LifecycleHook]
|
140
|
+
# Returns the data for this {LifecycleHook}. Calls
|
141
|
+
# {Client#describe_lifecycle_hooks} if {#data_loaded?} is `false`.
|
142
|
+
def data
|
143
|
+
load unless @data
|
144
|
+
@data
|
145
|
+
end
|
147
146
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
147
|
+
# @return [Boolean]
|
148
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
149
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
150
|
+
def data_loaded?
|
151
|
+
!!@data
|
152
|
+
end
|
154
153
|
|
155
|
-
|
154
|
+
# @!group Actions
|
156
155
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
156
|
+
# @example Request syntax with placeholder values
|
157
|
+
#
|
158
|
+
# lifecycle_hook.complete({
|
159
|
+
# lifecycle_action_token: "LifecycleActionToken",
|
160
|
+
# lifecycle_action_result: "LifecycleActionResult", # required
|
161
|
+
# instance_id: "XmlStringMaxLen19",
|
162
|
+
# })
|
163
|
+
# @param [Hash] options ({})
|
164
|
+
# @option options [String] :lifecycle_action_token
|
165
|
+
# A universally unique identifier (UUID) that identifies a specific
|
166
|
+
# lifecycle action associated with an instance. Auto Scaling sends this
|
167
|
+
# token to the notification target you specified when you created the
|
168
|
+
# lifecycle hook.
|
169
|
+
# @option options [required, String] :lifecycle_action_result
|
170
|
+
# The action for the group to take. This parameter can be either
|
171
|
+
# `CONTINUE` or `ABANDON`.
|
172
|
+
# @option options [String] :instance_id
|
173
|
+
# The ID of the instance.
|
174
|
+
# @return [Types::CompleteLifecycleActionAnswer]
|
175
|
+
def complete(options = {})
|
176
|
+
options = options.merge(
|
177
|
+
auto_scaling_group_name: @group_name,
|
178
|
+
lifecycle_hook_name: @name
|
179
|
+
)
|
180
|
+
resp = @client.complete_lifecycle_action(options)
|
181
|
+
resp.data
|
182
|
+
end
|
184
183
|
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
184
|
+
# @example Request syntax with placeholder values
|
185
|
+
#
|
186
|
+
# lifecycle_hook.delete()
|
187
|
+
# @param [Hash] options ({})
|
188
|
+
# @return [Types::DeleteLifecycleHookAnswer]
|
189
|
+
def delete(options = {})
|
190
|
+
options = options.merge(
|
191
|
+
auto_scaling_group_name: @group_name,
|
192
|
+
lifecycle_hook_name: @name
|
193
|
+
)
|
194
|
+
resp = @client.delete_lifecycle_hook(options)
|
195
|
+
resp.data
|
196
|
+
end
|
198
197
|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
198
|
+
# @example Request syntax with placeholder values
|
199
|
+
#
|
200
|
+
# lifecycle_hook.put({
|
201
|
+
# lifecycle_transition: "LifecycleTransition",
|
202
|
+
# role_arn: "ResourceName",
|
203
|
+
# notification_target_arn: "NotificationTargetResourceName",
|
204
|
+
# notification_metadata: "XmlStringMaxLen1023",
|
205
|
+
# heartbeat_timeout: 1,
|
206
|
+
# default_result: "LifecycleActionResult",
|
207
|
+
# })
|
208
|
+
# @param [Hash] options ({})
|
209
|
+
# @option options [String] :lifecycle_transition
|
210
|
+
# The instance state to which you want to attach the lifecycle hook. For
|
211
|
+
# a list of lifecycle hook types, see DescribeLifecycleHookTypes.
|
212
|
+
#
|
213
|
+
# This parameter is required for new lifecycle hooks, but optional when
|
214
|
+
# updating existing hooks.
|
215
|
+
# @option options [String] :role_arn
|
216
|
+
# The ARN of the IAM role that allows the Auto Scaling group to publish
|
217
|
+
# to the specified notification target.
|
218
|
+
#
|
219
|
+
# This parameter is required for new lifecycle hooks, but optional when
|
220
|
+
# updating existing hooks.
|
221
|
+
# @option options [String] :notification_target_arn
|
222
|
+
# The ARN of the notification target that Auto Scaling will use to
|
223
|
+
# notify you when an instance is in the transition state for the
|
224
|
+
# lifecycle hook. This target can be either an SQS queue or an SNS
|
225
|
+
# topic. If you specify an empty string, this overrides the current ARN.
|
226
|
+
#
|
227
|
+
# This operation uses the JSON format when sending notifications to an
|
228
|
+
# Amazon SQS queue, and an email key/value pair format when sending
|
229
|
+
# notifications to an Amazon SNS topic.
|
230
|
+
#
|
231
|
+
# When you specify a notification target, Auto Scaling sends it a test
|
232
|
+
# message. Test messages contains the following additional key/value
|
233
|
+
# pair: `"Event": "autoscaling:TEST_NOTIFICATION"`.
|
234
|
+
# @option options [String] :notification_metadata
|
235
|
+
# Contains additional information that you want to include any time Auto
|
236
|
+
# Scaling sends a message to the notification target.
|
237
|
+
# @option options [Integer] :heartbeat_timeout
|
238
|
+
# The amount of time, in seconds, that can elapse before the lifecycle
|
239
|
+
# hook times out. When the lifecycle hook times out, Auto Scaling
|
240
|
+
# performs the default action. You can prevent the lifecycle hook from
|
241
|
+
# timing out by calling RecordLifecycleActionHeartbeat. The default is
|
242
|
+
# 3600 seconds (1 hour).
|
243
|
+
# @option options [String] :default_result
|
244
|
+
# Defines the action the Auto Scaling group should take when the
|
245
|
+
# lifecycle hook timeout elapses or if an unexpected failure occurs.
|
246
|
+
# This parameter can be either `CONTINUE` or `ABANDON`. The default
|
247
|
+
# value is `ABANDON`.
|
248
|
+
# @return [Types::PutLifecycleHookAnswer]
|
249
|
+
def put(options = {})
|
250
|
+
options = options.merge(
|
251
|
+
auto_scaling_group_name: @group_name,
|
252
|
+
lifecycle_hook_name: @name
|
253
|
+
)
|
254
|
+
resp = @client.put_lifecycle_hook(options)
|
255
|
+
resp.data
|
256
|
+
end
|
258
257
|
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
258
|
+
# @example Request syntax with placeholder values
|
259
|
+
#
|
260
|
+
# lifecycle_hook.record_heartbeat({
|
261
|
+
# lifecycle_action_token: "LifecycleActionToken",
|
262
|
+
# instance_id: "XmlStringMaxLen19",
|
263
|
+
# })
|
264
|
+
# @param [Hash] options ({})
|
265
|
+
# @option options [String] :lifecycle_action_token
|
266
|
+
# A token that uniquely identifies a specific lifecycle action
|
267
|
+
# associated with an instance. Auto Scaling sends this token to the
|
268
|
+
# notification target you specified when you created the lifecycle hook.
|
269
|
+
# @option options [String] :instance_id
|
270
|
+
# The ID of the instance.
|
271
|
+
# @return [Types::RecordLifecycleActionHeartbeatAnswer]
|
272
|
+
def record_heartbeat(options = {})
|
273
|
+
options = options.merge(
|
274
|
+
auto_scaling_group_name: @group_name,
|
275
|
+
lifecycle_hook_name: @name
|
276
|
+
)
|
277
|
+
resp = @client.record_lifecycle_action_heartbeat(options)
|
278
|
+
resp.data
|
279
|
+
end
|
281
280
|
|
282
|
-
|
281
|
+
# @!group Associations
|
283
282
|
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
283
|
+
# @return [AutoScalingGroup]
|
284
|
+
def group
|
285
|
+
AutoScalingGroup.new(
|
286
|
+
name: @group_name,
|
287
|
+
client: @client
|
288
|
+
)
|
289
|
+
end
|
291
290
|
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
291
|
+
# @deprecated
|
292
|
+
# @api private
|
293
|
+
def identifiers
|
294
|
+
{
|
295
|
+
group_name: @group_name,
|
296
|
+
name: @name
|
297
|
+
}
|
298
|
+
end
|
299
|
+
deprecated(:identifiers)
|
301
300
|
|
302
|
-
|
301
|
+
private
|
303
302
|
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
end
|
303
|
+
def extract_group_name(args, options)
|
304
|
+
value = args[0] || options.delete(:group_name)
|
305
|
+
case value
|
306
|
+
when String then value
|
307
|
+
when nil then raise ArgumentError, "missing required option :group_name"
|
308
|
+
else
|
309
|
+
msg = "expected :group_name to be a String, got #{value.class}"
|
310
|
+
raise ArgumentError, msg
|
313
311
|
end
|
312
|
+
end
|
314
313
|
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
end
|
314
|
+
def extract_name(args, options)
|
315
|
+
value = args[1] || options.delete(:name)
|
316
|
+
case value
|
317
|
+
when String then value
|
318
|
+
when nil then raise ArgumentError, "missing required option :name"
|
319
|
+
else
|
320
|
+
msg = "expected :name to be a String, got #{value.class}"
|
321
|
+
raise ArgumentError, msg
|
324
322
|
end
|
325
|
-
|
326
|
-
class Collection < Aws::Resources::Collection; end
|
327
323
|
end
|
324
|
+
|
325
|
+
class Collection < Aws::Resources::Collection; end
|
328
326
|
end
|
329
327
|
end
|