aws-sdk-ec2 1.0.0.rc2 → 1.0.0.rc3
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-ec2.rb +2 -2
- data/lib/aws-sdk-ec2/classic_address.rb +198 -200
- data/lib/aws-sdk-ec2/client.rb +17169 -14563
- data/lib/aws-sdk-ec2/client_api.rb +6458 -6301
- data/lib/aws-sdk-ec2/dhcp_options.rb +158 -160
- data/lib/aws-sdk-ec2/errors.rb +4 -13
- data/lib/aws-sdk-ec2/image.rb +404 -406
- data/lib/aws-sdk-ec2/instance.rb +1423 -1422
- data/lib/aws-sdk-ec2/internet_gateway.rb +178 -180
- data/lib/aws-sdk-ec2/key_pair.rb +98 -100
- data/lib/aws-sdk-ec2/key_pair_info.rb +102 -104
- data/lib/aws-sdk-ec2/network_acl.rb +326 -328
- data/lib/aws-sdk-ec2/network_interface.rb +428 -430
- data/lib/aws-sdk-ec2/network_interface_association.rb +126 -128
- data/lib/aws-sdk-ec2/placement_group.rb +400 -399
- data/lib/aws-sdk-ec2/resource.rb +2696 -2659
- data/lib/aws-sdk-ec2/route.rb +229 -231
- data/lib/aws-sdk-ec2/route_table.rb +243 -245
- data/lib/aws-sdk-ec2/route_table_association.rb +148 -150
- data/lib/aws-sdk-ec2/security_group.rb +515 -517
- data/lib/aws-sdk-ec2/snapshot.rb +431 -433
- data/lib/aws-sdk-ec2/subnet.rb +981 -977
- data/lib/aws-sdk-ec2/tag.rb +185 -187
- data/lib/aws-sdk-ec2/types.rb +24081 -20965
- data/lib/aws-sdk-ec2/volume.rb +513 -512
- data/lib/aws-sdk-ec2/vpc.rb +1671 -1649
- data/lib/aws-sdk-ec2/vpc_address.rb +189 -191
- data/lib/aws-sdk-ec2/vpc_peering_connection.rb +219 -221
- data/lib/aws-sdk-ec2/waiters.rb +1252 -1210
- metadata +2 -2
data/lib/aws-sdk-ec2/vpc.rb
CHANGED
@@ -1,1740 +1,1762 @@
|
|
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 Vpc
|
8
|
+
module Aws::EC2
|
9
|
+
class Vpc
|
11
10
|
|
12
|
-
|
11
|
+
extend Aws::Deprecations
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
13
|
+
# @overload def initialize(id, options = {})
|
14
|
+
# @param [String] id
|
15
|
+
# @option options [Client] :client
|
16
|
+
# @overload def initialize(options = {})
|
17
|
+
# @option options [required, String] :id
|
18
|
+
# @option options [Client] :client
|
19
|
+
def initialize(*args)
|
20
|
+
options = Hash === args.last ? args.pop.dup : {}
|
21
|
+
@id = extract_id(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 id
|
30
|
+
@id
|
31
|
+
end
|
32
|
+
alias :vpc_id :id
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
# The current state of the VPC.
|
35
|
+
# @return [String]
|
36
|
+
def state
|
37
|
+
data.state
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
# The IPv4 CIDR block for the VPC.
|
41
|
+
# @return [String]
|
42
|
+
def cidr_block
|
43
|
+
data.cidr_block
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
46
|
+
# The ID of the set of DHCP options you've associated with the VPC (or
|
47
|
+
# `default` if the default options are associated with the VPC).
|
48
|
+
# @return [String]
|
49
|
+
def dhcp_options_id
|
50
|
+
data.dhcp_options_id
|
51
|
+
end
|
53
52
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
53
|
+
# Any tags assigned to the VPC.
|
54
|
+
# @return [Array<Types::Tag>]
|
55
|
+
def tags
|
56
|
+
data.tags
|
57
|
+
end
|
59
58
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
59
|
+
# The allowed tenancy of instances launched into the VPC.
|
60
|
+
# @return [String]
|
61
|
+
def instance_tenancy
|
62
|
+
data.instance_tenancy
|
63
|
+
end
|
65
64
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
65
|
+
# Indicates whether the VPC is the default VPC.
|
66
|
+
# @return [Boolean]
|
67
|
+
def is_default
|
68
|
+
data.is_default
|
69
|
+
end
|
71
70
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
71
|
+
# Information about the IPv6 CIDR blocks associated with the VPC.
|
72
|
+
# @return [Array<Types::VpcIpv6CidrBlockAssociation>]
|
73
|
+
def ipv_6_cidr_block_association_set
|
74
|
+
data.ipv_6_cidr_block_association_set
|
75
|
+
end
|
77
76
|
|
78
|
-
|
77
|
+
# @!endgroup
|
79
78
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
79
|
+
# @return [Client]
|
80
|
+
def client
|
81
|
+
@client
|
82
|
+
end
|
84
83
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
84
|
+
# Loads, or reloads {#data} for the current {Vpc}.
|
85
|
+
# Returns `self` making it possible to chain methods.
|
86
|
+
#
|
87
|
+
# vpc.reload.data
|
88
|
+
#
|
89
|
+
# @return [self]
|
90
|
+
def load
|
91
|
+
resp = @client.describe_vpcs(vpc_ids: [@id])
|
92
|
+
@data = resp.vpcs[0]
|
93
|
+
self
|
94
|
+
end
|
95
|
+
alias :reload :load
|
97
96
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
97
|
+
# @return [Types::Vpc]
|
98
|
+
# Returns the data for this {Vpc}. Calls
|
99
|
+
# {Client#describe_vpcs} if {#data_loaded?} is `false`.
|
100
|
+
def data
|
101
|
+
load unless @data
|
102
|
+
@data
|
103
|
+
end
|
105
104
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
105
|
+
# @return [Boolean]
|
106
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
107
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
108
|
+
def data_loaded?
|
109
|
+
!!@data
|
110
|
+
end
|
112
111
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
end
|
112
|
+
# @param [Hash] options ({})
|
113
|
+
# @return [Boolean]
|
114
|
+
# Returns `true` if the Vpc exists.
|
115
|
+
def exists?(options = {})
|
116
|
+
begin
|
117
|
+
wait_until_exists(options.merge(max_attempts: 1))
|
118
|
+
true
|
119
|
+
rescue Aws::Waiters::Errors::UnexpectedError => e
|
120
|
+
raise e.error
|
121
|
+
rescue Aws::Waiters::Errors::WaiterFailed
|
122
|
+
false
|
125
123
|
end
|
124
|
+
end
|
126
125
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
126
|
+
# @param [Hash] options ({})
|
127
|
+
# @option options [Integer] :max_attempts (40)
|
128
|
+
# @option options [Float] :delay (15)
|
129
|
+
# @option options [Proc] :before_attempt
|
130
|
+
# @option options [Proc] :before_wait
|
131
|
+
# @return [Vpc]
|
132
|
+
def wait_until_available(options = {})
|
133
|
+
options, params = separate_params_and_options(options)
|
134
|
+
waiter = Waiters::VpcAvailable.new(options)
|
135
|
+
yield_waiter_and_warn(waiter, &Proc.new) if block_given?
|
136
|
+
waiter.wait(params.merge(vpc_ids: [@id]))
|
137
|
+
Vpc.new({
|
138
|
+
id: @id,
|
139
|
+
client: @client
|
140
|
+
})
|
141
|
+
end
|
143
142
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
143
|
+
# @param [Hash] options ({})
|
144
|
+
# @option options [Integer] :max_attempts (5)
|
145
|
+
# @option options [Float] :delay (1)
|
146
|
+
# @option options [Proc] :before_attempt
|
147
|
+
# @option options [Proc] :before_wait
|
148
|
+
# @return [Vpc]
|
149
|
+
def wait_until_exists(options = {})
|
150
|
+
options, params = separate_params_and_options(options)
|
151
|
+
waiter = Waiters::VpcExists.new(options)
|
152
|
+
yield_waiter_and_warn(waiter, &Proc.new) if block_given?
|
153
|
+
waiter.wait(params.merge(vpc_ids: [@id]))
|
154
|
+
Vpc.new({
|
155
|
+
id: @id,
|
156
|
+
client: @client
|
157
|
+
})
|
158
|
+
end
|
160
159
|
|
161
|
-
|
160
|
+
# @!group Actions
|
162
161
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
162
|
+
# @example Request syntax with placeholder values
|
163
|
+
#
|
164
|
+
# vpc.associate_dhcp_options({
|
165
|
+
# dry_run: false,
|
166
|
+
# dhcp_options_id: "String", # required
|
167
|
+
# })
|
168
|
+
# @param [Hash] options ({})
|
169
|
+
# @option options [Boolean] :dry_run
|
170
|
+
# Checks whether you have the required permissions for the action,
|
171
|
+
# without actually making the request, and provides an error response.
|
172
|
+
# If you have the required permissions, the error response is
|
173
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
174
|
+
# @option options [required, String] :dhcp_options_id
|
175
|
+
# The ID of the DHCP options set, or `default` to associate no DHCP
|
176
|
+
# options with the VPC.
|
177
|
+
# @return [EmptyStructure]
|
178
|
+
def associate_dhcp_options(options = {})
|
179
|
+
options = options.merge(vpc_id: @id)
|
180
|
+
resp = @client.associate_dhcp_options(options)
|
181
|
+
resp.data
|
182
|
+
end
|
184
183
|
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
184
|
+
# @example Request syntax with placeholder values
|
185
|
+
#
|
186
|
+
# vpc.attach_classic_link_instance({
|
187
|
+
# dry_run: false,
|
188
|
+
# instance_id: "String", # required
|
189
|
+
# groups: ["String"], # required
|
190
|
+
# })
|
191
|
+
# @param [Hash] options ({})
|
192
|
+
# @option options [Boolean] :dry_run
|
193
|
+
# Checks whether you have the required permissions for the action,
|
194
|
+
# without actually making the request, and provides an error response.
|
195
|
+
# If you have the required permissions, the error response is
|
196
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
197
|
+
# @option options [required, String] :instance_id
|
198
|
+
# The ID of an EC2-Classic instance to link to the ClassicLink-enabled
|
199
|
+
# VPC.
|
200
|
+
# @option options [required, Array<String>] :groups
|
201
|
+
# The ID of one or more of the VPC's security groups. You cannot
|
202
|
+
# specify security groups from a different VPC.
|
203
|
+
# @return [Types::AttachClassicLinkVpcResult]
|
204
|
+
def attach_classic_link_instance(options = {})
|
205
|
+
options = options.merge(vpc_id: @id)
|
206
|
+
resp = @client.attach_classic_link_vpc(options)
|
207
|
+
resp.data
|
208
|
+
end
|
210
209
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
210
|
+
# @example Request syntax with placeholder values
|
211
|
+
#
|
212
|
+
# vpc.attach_internet_gateway({
|
213
|
+
# dry_run: false,
|
214
|
+
# internet_gateway_id: "String", # required
|
215
|
+
# })
|
216
|
+
# @param [Hash] options ({})
|
217
|
+
# @option options [Boolean] :dry_run
|
218
|
+
# Checks whether you have the required permissions for the action,
|
219
|
+
# without actually making the request, and provides an error response.
|
220
|
+
# If you have the required permissions, the error response is
|
221
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
222
|
+
# @option options [required, String] :internet_gateway_id
|
223
|
+
# The ID of the Internet gateway.
|
224
|
+
# @return [EmptyStructure]
|
225
|
+
def attach_internet_gateway(options = {})
|
226
|
+
options = options.merge(vpc_id: @id)
|
227
|
+
resp = @client.attach_internet_gateway(options)
|
228
|
+
resp.data
|
229
|
+
end
|
231
230
|
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
231
|
+
# @example Request syntax with placeholder values
|
232
|
+
#
|
233
|
+
# networkacl = vpc.create_network_acl({
|
234
|
+
# dry_run: false,
|
235
|
+
# })
|
236
|
+
# @param [Hash] options ({})
|
237
|
+
# @option options [Boolean] :dry_run
|
238
|
+
# Checks whether you have the required permissions for the action,
|
239
|
+
# without actually making the request, and provides an error response.
|
240
|
+
# If you have the required permissions, the error response is
|
241
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
242
|
+
# @return [NetworkAcl]
|
243
|
+
def create_network_acl(options = {})
|
244
|
+
options = options.merge(vpc_id: @id)
|
245
|
+
resp = @client.create_network_acl(options)
|
246
|
+
NetworkAcl.new(
|
247
|
+
id: resp.data.network_acl.network_acl_id,
|
248
|
+
data: resp.data.network_acl,
|
249
|
+
client: @client
|
250
|
+
)
|
251
|
+
end
|
253
252
|
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
253
|
+
# @example Request syntax with placeholder values
|
254
|
+
#
|
255
|
+
# routetable = vpc.create_route_table({
|
256
|
+
# dry_run: false,
|
257
|
+
# })
|
258
|
+
# @param [Hash] options ({})
|
259
|
+
# @option options [Boolean] :dry_run
|
260
|
+
# Checks whether you have the required permissions for the action,
|
261
|
+
# without actually making the request, and provides an error response.
|
262
|
+
# If you have the required permissions, the error response is
|
263
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
264
|
+
# @return [RouteTable]
|
265
|
+
def create_route_table(options = {})
|
266
|
+
options = options.merge(vpc_id: @id)
|
267
|
+
resp = @client.create_route_table(options)
|
268
|
+
RouteTable.new(
|
269
|
+
id: resp.data.route_table.route_table_id,
|
270
|
+
data: resp.data.route_table,
|
271
|
+
client: @client
|
272
|
+
)
|
273
|
+
end
|
275
274
|
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
275
|
+
# @example Request syntax with placeholder values
|
276
|
+
#
|
277
|
+
# securitygroup = vpc.create_security_group({
|
278
|
+
# dry_run: false,
|
279
|
+
# group_name: "String", # required
|
280
|
+
# description: "String", # required
|
281
|
+
# })
|
282
|
+
# @param [Hash] options ({})
|
283
|
+
# @option options [Boolean] :dry_run
|
284
|
+
# Checks whether you have the required permissions for the action,
|
285
|
+
# without actually making the request, and provides an error response.
|
286
|
+
# If you have the required permissions, the error response is
|
287
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
288
|
+
# @option options [required, String] :group_name
|
289
|
+
# The name of the security group.
|
290
|
+
#
|
291
|
+
# Constraints: Up to 255 characters in length
|
292
|
+
#
|
293
|
+
# Constraints for EC2-Classic: ASCII characters
|
294
|
+
#
|
295
|
+
# Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and
|
296
|
+
# .\_-:/()#,@\[\]+=&;\\\{\\}!$*
|
297
|
+
# @option options [required, String] :description
|
298
|
+
# A description for the security group. This is informational only.
|
299
|
+
#
|
300
|
+
# Constraints: Up to 255 characters in length
|
301
|
+
#
|
302
|
+
# Constraints for EC2-Classic: ASCII characters
|
303
|
+
#
|
304
|
+
# Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and
|
305
|
+
# .\_-:/()#,@\[\]+=&;\\\{\\}!$*
|
306
|
+
# @return [SecurityGroup]
|
307
|
+
def create_security_group(options = {})
|
308
|
+
options = options.merge(vpc_id: @id)
|
309
|
+
resp = @client.create_security_group(options)
|
310
|
+
SecurityGroup.new(
|
311
|
+
id: resp.data.group_id,
|
312
|
+
client: @client
|
313
|
+
)
|
314
|
+
end
|
316
315
|
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
316
|
+
# @example Request syntax with placeholder values
|
317
|
+
#
|
318
|
+
# subnet = vpc.create_subnet({
|
319
|
+
# dry_run: false,
|
320
|
+
# cidr_block: "String", # required
|
321
|
+
# ipv_6_cidr_block: "String",
|
322
|
+
# availability_zone: "String",
|
323
|
+
# })
|
324
|
+
# @param [Hash] options ({})
|
325
|
+
# @option options [Boolean] :dry_run
|
326
|
+
# Checks whether you have the required permissions for the action,
|
327
|
+
# without actually making the request, and provides an error response.
|
328
|
+
# If you have the required permissions, the error response is
|
329
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
330
|
+
# @option options [required, String] :cidr_block
|
331
|
+
# The IPv4 network range for the subnet, in CIDR notation. For example,
|
332
|
+
# `10.0.0.0/24`.
|
333
|
+
# @option options [String] :ipv_6_cidr_block
|
334
|
+
# The IPv6 network range for the subnet, in CIDR notation. The subnet
|
335
|
+
# size must use a /64 prefix length.
|
336
|
+
# @option options [String] :availability_zone
|
337
|
+
# The Availability Zone for the subnet.
|
338
|
+
#
|
339
|
+
# Default: AWS selects one for you. If you create more than one subnet
|
340
|
+
# in your VPC, we may not necessarily select a different zone for each
|
341
|
+
# subnet.
|
342
|
+
# @return [Subnet]
|
343
|
+
def create_subnet(options = {})
|
344
|
+
options = options.merge(vpc_id: @id)
|
345
|
+
resp = @client.create_subnet(options)
|
346
|
+
Subnet.new(
|
347
|
+
id: resp.data.subnet.subnet_id,
|
348
|
+
data: resp.data.subnet,
|
349
|
+
client: @client
|
350
|
+
)
|
351
|
+
end
|
352
|
+
|
353
|
+
# @example Request syntax with placeholder values
|
354
|
+
#
|
355
|
+
# tag = vpc.create_tags({
|
356
|
+
# dry_run: false,
|
357
|
+
# tags: [ # required
|
358
|
+
# {
|
359
|
+
# key: "String",
|
360
|
+
# value: "String",
|
361
|
+
# },
|
362
|
+
# ],
|
363
|
+
# })
|
364
|
+
# @param [Hash] options ({})
|
365
|
+
# @option options [Boolean] :dry_run
|
366
|
+
# Checks whether you have the required permissions for the action,
|
367
|
+
# without actually making the request, and provides an error response.
|
368
|
+
# If you have the required permissions, the error response is
|
369
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
370
|
+
# @option options [required, Array<Types::Tag>] :tags
|
371
|
+
# One or more tags. The `value` parameter is required, but if you don't
|
372
|
+
# want the tag to have a value, specify the parameter with no value, and
|
373
|
+
# we set the value to an empty string.
|
374
|
+
# @return [Tag::Collection]
|
375
|
+
def create_tags(options = {})
|
376
|
+
batch = []
|
377
|
+
options = Aws::Util.deep_merge(options, resources: [@id])
|
378
|
+
resp = @client.create_tags(options)
|
379
|
+
options[:tags].each do |t|
|
380
|
+
batch << Tag.new(
|
381
|
+
resource_id: @id,
|
382
|
+
key: t[:key],
|
383
|
+
value: t[:value],
|
350
384
|
client: @client
|
351
385
|
)
|
352
386
|
end
|
387
|
+
Tag::Collection.new([batch], size: batch.size)
|
388
|
+
end
|
353
389
|
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
# @option options [required, Array<Types::Tag>] :tags
|
372
|
-
# One or more tags. The `value` parameter is required, but if you don't
|
373
|
-
# want the tag to have a value, specify the parameter with no value, and
|
374
|
-
# we set the value to an empty string.
|
375
|
-
# @return [Tag::Collection]
|
376
|
-
def create_tags(options = {})
|
377
|
-
batch = []
|
378
|
-
options = Aws::Util.deep_merge(options, resources: [@id])
|
379
|
-
resp = @client.create_tags(options)
|
380
|
-
options[:tags].each do |t|
|
381
|
-
batch << Tag.new(
|
382
|
-
resource_id: @id,
|
383
|
-
key: t[:key],
|
384
|
-
value: t[:value],
|
385
|
-
client: @client
|
386
|
-
)
|
387
|
-
end
|
388
|
-
Tag::Collection.new([batch], size: batch.size)
|
389
|
-
end
|
390
|
+
# @example Request syntax with placeholder values
|
391
|
+
#
|
392
|
+
# vpc.delete({
|
393
|
+
# dry_run: false,
|
394
|
+
# })
|
395
|
+
# @param [Hash] options ({})
|
396
|
+
# @option options [Boolean] :dry_run
|
397
|
+
# Checks whether you have the required permissions for the action,
|
398
|
+
# without actually making the request, and provides an error response.
|
399
|
+
# If you have the required permissions, the error response is
|
400
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
401
|
+
# @return [EmptyStructure]
|
402
|
+
def delete(options = {})
|
403
|
+
options = options.merge(vpc_id: @id)
|
404
|
+
resp = @client.delete_vpc(options)
|
405
|
+
resp.data
|
406
|
+
end
|
390
407
|
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
+
# @example Request syntax with placeholder values
|
409
|
+
#
|
410
|
+
# vpc.describe_attribute({
|
411
|
+
# dry_run: false,
|
412
|
+
# attribute: "enableDnsSupport", # required, accepts enableDnsSupport, enableDnsHostnames
|
413
|
+
# })
|
414
|
+
# @param [Hash] options ({})
|
415
|
+
# @option options [Boolean] :dry_run
|
416
|
+
# Checks whether you have the required permissions for the action,
|
417
|
+
# without actually making the request, and provides an error response.
|
418
|
+
# If you have the required permissions, the error response is
|
419
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
420
|
+
# @option options [required, String] :attribute
|
421
|
+
# The VPC attribute.
|
422
|
+
# @return [Types::DescribeVpcAttributeResult]
|
423
|
+
def describe_attribute(options = {})
|
424
|
+
options = options.merge(vpc_id: @id)
|
425
|
+
resp = @client.describe_vpc_attribute(options)
|
426
|
+
resp.data
|
427
|
+
end
|
408
428
|
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
+
# @example Request syntax with placeholder values
|
430
|
+
#
|
431
|
+
# vpc.detach_classic_link_instance({
|
432
|
+
# dry_run: false,
|
433
|
+
# instance_id: "String", # required
|
434
|
+
# })
|
435
|
+
# @param [Hash] options ({})
|
436
|
+
# @option options [Boolean] :dry_run
|
437
|
+
# Checks whether you have the required permissions for the action,
|
438
|
+
# without actually making the request, and provides an error response.
|
439
|
+
# If you have the required permissions, the error response is
|
440
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
441
|
+
# @option options [required, String] :instance_id
|
442
|
+
# The ID of the instance to unlink from the VPC.
|
443
|
+
# @return [Types::DetachClassicLinkVpcResult]
|
444
|
+
def detach_classic_link_instance(options = {})
|
445
|
+
options = options.merge(vpc_id: @id)
|
446
|
+
resp = @client.detach_classic_link_vpc(options)
|
447
|
+
resp.data
|
448
|
+
end
|
429
449
|
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
+
# @example Request syntax with placeholder values
|
451
|
+
#
|
452
|
+
# vpc.detach_internet_gateway({
|
453
|
+
# dry_run: false,
|
454
|
+
# internet_gateway_id: "String", # required
|
455
|
+
# })
|
456
|
+
# @param [Hash] options ({})
|
457
|
+
# @option options [Boolean] :dry_run
|
458
|
+
# Checks whether you have the required permissions for the action,
|
459
|
+
# without actually making the request, and provides an error response.
|
460
|
+
# If you have the required permissions, the error response is
|
461
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
462
|
+
# @option options [required, String] :internet_gateway_id
|
463
|
+
# The ID of the Internet gateway.
|
464
|
+
# @return [EmptyStructure]
|
465
|
+
def detach_internet_gateway(options = {})
|
466
|
+
options = options.merge(vpc_id: @id)
|
467
|
+
resp = @client.detach_internet_gateway(options)
|
468
|
+
resp.data
|
469
|
+
end
|
450
470
|
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
resp = @client.detach_internet_gateway(options)
|
469
|
-
resp.data
|
470
|
-
end
|
471
|
+
# @example Request syntax with placeholder values
|
472
|
+
#
|
473
|
+
# vpc.disable_classic_link({
|
474
|
+
# dry_run: false,
|
475
|
+
# })
|
476
|
+
# @param [Hash] options ({})
|
477
|
+
# @option options [Boolean] :dry_run
|
478
|
+
# Checks whether you have the required permissions for the action,
|
479
|
+
# without actually making the request, and provides an error response.
|
480
|
+
# If you have the required permissions, the error response is
|
481
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
482
|
+
# @return [Types::DisableVpcClassicLinkResult]
|
483
|
+
def disable_classic_link(options = {})
|
484
|
+
options = options.merge(vpc_id: @id)
|
485
|
+
resp = @client.disable_vpc_classic_link(options)
|
486
|
+
resp.data
|
487
|
+
end
|
471
488
|
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
+
# @example Request syntax with placeholder values
|
490
|
+
#
|
491
|
+
# vpc.enable_classic_link({
|
492
|
+
# dry_run: false,
|
493
|
+
# })
|
494
|
+
# @param [Hash] options ({})
|
495
|
+
# @option options [Boolean] :dry_run
|
496
|
+
# Checks whether you have the required permissions for the action,
|
497
|
+
# without actually making the request, and provides an error response.
|
498
|
+
# If you have the required permissions, the error response is
|
499
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
500
|
+
# @return [Types::EnableVpcClassicLinkResult]
|
501
|
+
def enable_classic_link(options = {})
|
502
|
+
options = options.merge(vpc_id: @id)
|
503
|
+
resp = @client.enable_vpc_classic_link(options)
|
504
|
+
resp.data
|
505
|
+
end
|
489
506
|
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
+
# @example Request syntax with placeholder values
|
508
|
+
#
|
509
|
+
# vpc.modify_attribute({
|
510
|
+
# enable_dns_support: {
|
511
|
+
# value: false,
|
512
|
+
# },
|
513
|
+
# enable_dns_hostnames: {
|
514
|
+
# value: false,
|
515
|
+
# },
|
516
|
+
# })
|
517
|
+
# @param [Hash] options ({})
|
518
|
+
# @option options [Types::AttributeBooleanValue] :enable_dns_support
|
519
|
+
# Indicates whether the DNS resolution is supported for the VPC. If
|
520
|
+
# enabled, queries to the Amazon provided DNS server at the
|
521
|
+
# 169.254.169.253 IP address, or the reserved IP address at the base of
|
522
|
+
# the VPC network range "plus two" will succeed. If disabled, the
|
523
|
+
# Amazon provided DNS service in the VPC that resolves public DNS
|
524
|
+
# hostnames to IP addresses is not enabled.
|
525
|
+
#
|
526
|
+
# You cannot modify the DNS resolution and DNS hostnames attributes in
|
527
|
+
# the same request. Use separate requests for each attribute.
|
528
|
+
# @option options [Types::AttributeBooleanValue] :enable_dns_hostnames
|
529
|
+
# Indicates whether the instances launched in the VPC get DNS hostnames.
|
530
|
+
# If enabled, instances in the VPC get DNS hostnames; otherwise, they do
|
531
|
+
# not.
|
532
|
+
#
|
533
|
+
# You cannot modify the DNS resolution and DNS hostnames attributes in
|
534
|
+
# the same request. Use separate requests for each attribute. You can
|
535
|
+
# only enable DNS hostnames if you've enabled DNS support.
|
536
|
+
# @return [EmptyStructure]
|
537
|
+
def modify_attribute(options = {})
|
538
|
+
options = options.merge(vpc_id: @id)
|
539
|
+
resp = @client.modify_vpc_attribute(options)
|
540
|
+
resp.data
|
541
|
+
end
|
542
|
+
|
543
|
+
# @example Request syntax with placeholder values
|
544
|
+
#
|
545
|
+
# vpcpeeringconnection = vpc.request_vpc_peering_connection({
|
546
|
+
# dry_run: false,
|
547
|
+
# peer_vpc_id: "String",
|
548
|
+
# peer_owner_id: "String",
|
549
|
+
# })
|
550
|
+
# @param [Hash] options ({})
|
551
|
+
# @option options [Boolean] :dry_run
|
552
|
+
# Checks whether you have the required permissions for the action,
|
553
|
+
# without actually making the request, and provides an error response.
|
554
|
+
# If you have the required permissions, the error response is
|
555
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
556
|
+
# @option options [String] :peer_vpc_id
|
557
|
+
# The ID of the VPC with which you are creating the VPC peering
|
558
|
+
# connection.
|
559
|
+
# @option options [String] :peer_owner_id
|
560
|
+
# The AWS account ID of the owner of the peer VPC.
|
561
|
+
#
|
562
|
+
# Default: Your AWS account ID
|
563
|
+
# @return [VpcPeeringConnection]
|
564
|
+
def request_vpc_peering_connection(options = {})
|
565
|
+
options = options.merge(vpc_id: @id)
|
566
|
+
resp = @client.create_vpc_peering_connection(options)
|
567
|
+
VpcPeeringConnection.new(
|
568
|
+
id: resp.data.vpc_peering_connection.vpc_peering_connection_id,
|
569
|
+
data: resp.data.vpc_peering_connection,
|
570
|
+
client: @client
|
571
|
+
)
|
572
|
+
end
|
573
|
+
|
574
|
+
# @!group Associations
|
507
575
|
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
576
|
+
# @example Request syntax with placeholder values
|
577
|
+
#
|
578
|
+
# accepted_vpc_peering_connections = vpc.accepted_vpc_peering_connections({
|
579
|
+
# dry_run: false,
|
580
|
+
# vpc_peering_connection_ids: ["String"],
|
581
|
+
# filters: [
|
582
|
+
# {
|
583
|
+
# name: "String",
|
584
|
+
# values: ["String"],
|
585
|
+
# },
|
586
|
+
# ],
|
587
|
+
# })
|
588
|
+
# @param [Hash] options ({})
|
589
|
+
# @option options [Boolean] :dry_run
|
590
|
+
# Checks whether you have the required permissions for the action,
|
591
|
+
# without actually making the request, and provides an error response.
|
592
|
+
# If you have the required permissions, the error response is
|
593
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
594
|
+
# @option options [Array<String>] :vpc_peering_connection_ids
|
595
|
+
# One or more VPC peering connection IDs.
|
596
|
+
#
|
597
|
+
# Default: Describes all your VPC peering connections.
|
598
|
+
# @option options [Array<Types::Filter>] :filters
|
599
|
+
# One or more filters.
|
600
|
+
#
|
601
|
+
# * `accepter-vpc-info.cidr-block` - The IPv4 CIDR block of the peer
|
602
|
+
# VPC.
|
603
|
+
#
|
604
|
+
# * `accepter-vpc-info.owner-id` - The AWS account ID of the owner of
|
605
|
+
# the peer VPC.
|
606
|
+
#
|
607
|
+
# * `accepter-vpc-info.vpc-id` - The ID of the peer VPC.
|
608
|
+
#
|
609
|
+
# * `expiration-time` - The expiration date and time for the VPC peering
|
610
|
+
# connection.
|
611
|
+
#
|
612
|
+
# * `requester-vpc-info.cidr-block` - The IPv4 CIDR block of the
|
613
|
+
# requester's VPC.
|
614
|
+
#
|
615
|
+
# * `requester-vpc-info.owner-id` - The AWS account ID of the owner of
|
616
|
+
# the requester VPC.
|
617
|
+
#
|
618
|
+
# * `requester-vpc-info.vpc-id` - The ID of the requester VPC.
|
619
|
+
#
|
620
|
+
# * `status-code` - The status of the VPC peering connection
|
621
|
+
# (`pending-acceptance` \| `failed` \| `expired` \| `provisioning` \|
|
622
|
+
# `active` \| `deleted` \| `rejected`).
|
623
|
+
#
|
624
|
+
# * `status-message` - A message that provides more information about
|
625
|
+
# the status of the VPC peering connection, if applicable.
|
626
|
+
#
|
627
|
+
# * `tag`\:*key*=*value* - The key/value combination of a tag assigned
|
628
|
+
# to the resource. Specify the key of the tag in the filter name and
|
629
|
+
# the value of the tag in the filter value. For example, for the tag
|
630
|
+
# Purpose=X, specify `tag:Purpose` for the filter name and `X` for the
|
631
|
+
# filter value.
|
632
|
+
#
|
633
|
+
# * `tag-key` - The key of a tag assigned to the resource. This filter
|
634
|
+
# is independent of the `tag-value` filter. For example, if you use
|
635
|
+
# both the filter "tag-key=Purpose" and the filter "tag-value=X",
|
636
|
+
# you get any resources assigned both the tag key Purpose (regardless
|
637
|
+
# of what the tag's value is), and the tag value X (regardless of
|
638
|
+
# what the tag's key is). If you want to list only resources where
|
639
|
+
# Purpose is X, see the `tag`\:*key*=*value* filter.
|
640
|
+
#
|
641
|
+
# * `tag-value` - The value of a tag assigned to the resource. This
|
642
|
+
# filter is independent of the `tag-key` filter.
|
643
|
+
#
|
644
|
+
# * `vpc-peering-connection-id` - The ID of the VPC peering connection.
|
645
|
+
# @return [VpcPeeringConnection::Collection]
|
646
|
+
def accepted_vpc_peering_connections(options = {})
|
647
|
+
batches = Enumerator.new do |y|
|
648
|
+
batch = []
|
649
|
+
options = Aws::Util.deep_merge(options, filters: [{
|
650
|
+
name: "accepter-vpc-info.vpc-id",
|
651
|
+
values: [@id]
|
652
|
+
}])
|
653
|
+
resp = @client.describe_vpc_peering_connections(options)
|
654
|
+
resp.data.vpc_peering_connections.each do |v|
|
655
|
+
batch << VpcPeeringConnection.new(
|
656
|
+
id: v.vpc_peering_connection_id,
|
657
|
+
data: v,
|
658
|
+
client: @client
|
659
|
+
)
|
660
|
+
end
|
661
|
+
y.yield(batch)
|
542
662
|
end
|
663
|
+
VpcPeeringConnection::Collection.new(batches)
|
664
|
+
end
|
543
665
|
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
# peer_owner_id: "String",
|
550
|
-
# })
|
551
|
-
# @param [Hash] options ({})
|
552
|
-
# @option options [Boolean] :dry_run
|
553
|
-
# Checks whether you have the required permissions for the action,
|
554
|
-
# without actually making the request, and provides an error response.
|
555
|
-
# If you have the required permissions, the error response is
|
556
|
-
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
557
|
-
# @option options [String] :peer_vpc_id
|
558
|
-
# The ID of the VPC with which you are creating the VPC peering
|
559
|
-
# connection.
|
560
|
-
# @option options [String] :peer_owner_id
|
561
|
-
# The AWS account ID of the owner of the peer VPC.
|
562
|
-
#
|
563
|
-
# Default: Your AWS account ID
|
564
|
-
# @return [VpcPeeringConnection]
|
565
|
-
def request_vpc_peering_connection(options = {})
|
566
|
-
options = options.merge(vpc_id: @id)
|
567
|
-
resp = @client.create_vpc_peering_connection(options)
|
568
|
-
VpcPeeringConnection.new(
|
569
|
-
id: resp.data.vpc_peering_connection.vpc_peering_connection_id,
|
570
|
-
data: resp.data.vpc_peering_connection,
|
666
|
+
# @return [DhcpOptions, nil]
|
667
|
+
def dhcp_options
|
668
|
+
if data.dhcp_options_id
|
669
|
+
DhcpOptions.new(
|
670
|
+
id: data.dhcp_options_id,
|
571
671
|
client: @client
|
572
672
|
)
|
673
|
+
else
|
674
|
+
nil
|
573
675
|
end
|
676
|
+
end
|
574
677
|
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
678
|
+
# @example Request syntax with placeholder values
|
679
|
+
#
|
680
|
+
# instances = vpc.instances({
|
681
|
+
# dry_run: false,
|
682
|
+
# instance_ids: ["String"],
|
683
|
+
# filters: [
|
684
|
+
# {
|
685
|
+
# name: "String",
|
686
|
+
# values: ["String"],
|
687
|
+
# },
|
688
|
+
# ],
|
689
|
+
# })
|
690
|
+
# @param [Hash] options ({})
|
691
|
+
# @option options [Boolean] :dry_run
|
692
|
+
# Checks whether you have the required permissions for the action,
|
693
|
+
# without actually making the request, and provides an error response.
|
694
|
+
# If you have the required permissions, the error response is
|
695
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
696
|
+
# @option options [Array<String>] :instance_ids
|
697
|
+
# One or more instance IDs.
|
698
|
+
#
|
699
|
+
# Default: Describes all your instances.
|
700
|
+
# @option options [Array<Types::Filter>] :filters
|
701
|
+
# One or more filters.
|
702
|
+
#
|
703
|
+
# * `affinity` - The affinity setting for an instance running on a
|
704
|
+
# Dedicated Host (`default` \| `host`).
|
705
|
+
#
|
706
|
+
# * `architecture` - The instance architecture (`i386` \| `x86_64`).
|
707
|
+
#
|
708
|
+
# * `association.public-ip` - The address of the Elastic IP address
|
709
|
+
# (IPv4) bound to the network interface.
|
710
|
+
#
|
711
|
+
# * `association.ip-owner-id` - The owner of the Elastic IP address
|
712
|
+
# (IPv4) associated with the network interface.
|
713
|
+
#
|
714
|
+
# * `association.allocation-id` - The allocation ID returned when you
|
715
|
+
# allocated the Elastic IP address (IPv4) for your network interface.
|
716
|
+
#
|
717
|
+
# * `association.association-id` - The association ID returned when the
|
718
|
+
# network interface was associated with an IPv4 address.
|
719
|
+
#
|
720
|
+
# * `availability-zone` - The Availability Zone of the instance.
|
721
|
+
#
|
722
|
+
# * `block-device-mapping.attach-time` - The attach time for an EBS
|
723
|
+
# volume mapped to the instance, for example,
|
724
|
+
# `2010-09-15T17:15:20.000Z`.
|
725
|
+
#
|
726
|
+
# * `block-device-mapping.delete-on-termination` - A Boolean that
|
727
|
+
# indicates whether the EBS volume is deleted on instance termination.
|
728
|
+
#
|
729
|
+
# * `block-device-mapping.device-name` - The device name for the EBS
|
730
|
+
# volume (for example, `/dev/sdh` or `xvdh`).
|
731
|
+
#
|
732
|
+
# * `block-device-mapping.status` - The status for the EBS volume
|
733
|
+
# (`attaching` \| `attached` \| `detaching` \| `detached`).
|
734
|
+
#
|
735
|
+
# * `block-device-mapping.volume-id` - The volume ID of the EBS volume.
|
736
|
+
#
|
737
|
+
# * `client-token` - The idempotency token you provided when you
|
738
|
+
# launched the instance.
|
739
|
+
#
|
740
|
+
# * `dns-name` - The public DNS name of the instance.
|
741
|
+
#
|
742
|
+
# * `group-id` - The ID of the security group for the instance.
|
743
|
+
# EC2-Classic only.
|
744
|
+
#
|
745
|
+
# * `group-name` - The name of the security group for the instance.
|
746
|
+
# EC2-Classic only.
|
747
|
+
#
|
748
|
+
# * `host-id` - The ID of the Dedicated Host on which the instance is
|
749
|
+
# running, if applicable.
|
750
|
+
#
|
751
|
+
# * `hypervisor` - The hypervisor type of the instance (`ovm` \| `xen`).
|
752
|
+
#
|
753
|
+
# * `iam-instance-profile.arn` - The instance profile associated with
|
754
|
+
# the instance. Specified as an ARN.
|
755
|
+
#
|
756
|
+
# * `image-id` - The ID of the image used to launch the instance.
|
757
|
+
#
|
758
|
+
# * `instance-id` - The ID of the instance.
|
759
|
+
#
|
760
|
+
# * `instance-lifecycle` - Indicates whether this is a Spot Instance or
|
761
|
+
# a Scheduled Instance (`spot` \| `scheduled`).
|
762
|
+
#
|
763
|
+
# * `instance-state-code` - The state of the instance, as a 16-bit
|
764
|
+
# unsigned integer. The high byte is an opaque internal value and
|
765
|
+
# should be ignored. The low byte is set based on the state
|
766
|
+
# represented. The valid values are: 0 (pending), 16 (running), 32
|
767
|
+
# (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped).
|
768
|
+
#
|
769
|
+
# * `instance-state-name` - The state of the instance (`pending` \|
|
770
|
+
# `running` \| `shutting-down` \| `terminated` \| `stopping` \|
|
771
|
+
# `stopped`).
|
772
|
+
#
|
773
|
+
# * `instance-type` - The type of instance (for example, `t2.micro`).
|
774
|
+
#
|
775
|
+
# * `instance.group-id` - The ID of the security group for the instance.
|
776
|
+
#
|
777
|
+
# * `instance.group-name` - The name of the security group for the
|
778
|
+
# instance.
|
779
|
+
#
|
780
|
+
# * `ip-address` - The public IPv4 address of the instance.
|
781
|
+
#
|
782
|
+
# * `kernel-id` - The kernel ID.
|
783
|
+
#
|
784
|
+
# * `key-name` - The name of the key pair used when the instance was
|
785
|
+
# launched.
|
786
|
+
#
|
787
|
+
# * `launch-index` - When launching multiple instances, this is the
|
788
|
+
# index for the instance in the launch group (for example, 0, 1, 2,
|
789
|
+
# and so on).
|
790
|
+
#
|
791
|
+
# * `launch-time` - The time when the instance was launched.
|
792
|
+
#
|
793
|
+
# * `monitoring-state` - Indicates whether detailed monitoring is
|
794
|
+
# enabled (`disabled` \| `enabled`).
|
795
|
+
#
|
796
|
+
# * `network-interface.addresses.private-ip-address` - The private IPv4
|
797
|
+
# address associated with the network interface.
|
798
|
+
#
|
799
|
+
# * `network-interface.addresses.primary` - Specifies whether the IPv4
|
800
|
+
# address of the network interface is the primary private IPv4
|
801
|
+
# address.
|
802
|
+
#
|
803
|
+
# * `network-interface.addresses.association.public-ip` - The ID of the
|
804
|
+
# association of an Elastic IP address (IPv4) with a network
|
805
|
+
# interface.
|
806
|
+
#
|
807
|
+
# * `network-interface.addresses.association.ip-owner-id` - The owner ID
|
808
|
+
# of the private IPv4 address associated with the network interface.
|
809
|
+
#
|
810
|
+
# * `network-interface.attachment.attachment-id` - The ID of the
|
811
|
+
# interface attachment.
|
812
|
+
#
|
813
|
+
# * `network-interface.attachment.instance-id` - The ID of the instance
|
814
|
+
# to which the network interface is attached.
|
815
|
+
#
|
816
|
+
# * `network-interface.attachment.instance-owner-id` - The owner ID of
|
817
|
+
# the instance to which the network interface is attached.
|
818
|
+
#
|
819
|
+
# * `network-interface.attachment.device-index` - The device index to
|
820
|
+
# which the network interface is attached.
|
821
|
+
#
|
822
|
+
# * `network-interface.attachment.status` - The status of the attachment
|
823
|
+
# (`attaching` \| `attached` \| `detaching` \| `detached`).
|
824
|
+
#
|
825
|
+
# * `network-interface.attachment.attach-time` - The time that the
|
826
|
+
# network interface was attached to an instance.
|
827
|
+
#
|
828
|
+
# * `network-interface.attachment.delete-on-termination` - Specifies
|
829
|
+
# whether the attachment is deleted when an instance is terminated.
|
830
|
+
#
|
831
|
+
# * `network-interface.availability-zone` - The Availability Zone for
|
832
|
+
# the network interface.
|
833
|
+
#
|
834
|
+
# * `network-interface.description` - The description of the network
|
835
|
+
# interface.
|
836
|
+
#
|
837
|
+
# * `network-interface.group-id` - The ID of a security group associated
|
838
|
+
# with the network interface.
|
839
|
+
#
|
840
|
+
# * `network-interface.group-name` - The name of a security group
|
841
|
+
# associated with the network interface.
|
842
|
+
#
|
843
|
+
# * `network-interface.ipv6-addresses.ipv6-address` - The IPv6 address
|
844
|
+
# associated with the network interface.
|
845
|
+
#
|
846
|
+
# * `network-interface.mac-address` - The MAC address of the network
|
847
|
+
# interface.
|
848
|
+
#
|
849
|
+
# * `network-interface.network-interface-id` - The ID of the network
|
850
|
+
# interface.
|
851
|
+
#
|
852
|
+
# * `network-interface.owner-id` - The ID of the owner of the network
|
853
|
+
# interface.
|
854
|
+
#
|
855
|
+
# * `network-interface.private-dns-name` - The private DNS name of the
|
856
|
+
# network interface.
|
857
|
+
#
|
858
|
+
# * `network-interface.requester-id` - The requester ID for the network
|
859
|
+
# interface.
|
860
|
+
#
|
861
|
+
# * `network-interface.requester-managed` - Indicates whether the
|
862
|
+
# network interface is being managed by AWS.
|
863
|
+
#
|
864
|
+
# * `network-interface.status` - The status of the network interface
|
865
|
+
# (`available`) \| `in-use`).
|
866
|
+
#
|
867
|
+
# * `network-interface.source-dest-check` - Whether the network
|
868
|
+
# interface performs source/destination checking. A value of `true`
|
869
|
+
# means checking is enabled, and `false` means checking is disabled.
|
870
|
+
# The value must be `false` for the network interface to perform
|
871
|
+
# network address translation (NAT) in your VPC.
|
872
|
+
#
|
873
|
+
# * `network-interface.subnet-id` - The ID of the subnet for the network
|
874
|
+
# interface.
|
875
|
+
#
|
876
|
+
# * `network-interface.vpc-id` - The ID of the VPC for the network
|
877
|
+
# interface.
|
878
|
+
#
|
879
|
+
# * `owner-id` - The AWS account ID of the instance owner.
|
880
|
+
#
|
881
|
+
# * `placement-group-name` - The name of the placement group for the
|
882
|
+
# instance.
|
883
|
+
#
|
884
|
+
# * `platform` - The platform. Use `windows` if you have Windows
|
885
|
+
# instances; otherwise, leave blank.
|
886
|
+
#
|
887
|
+
# * `private-dns-name` - The private IPv4 DNS name of the instance.
|
888
|
+
#
|
889
|
+
# * `private-ip-address` - The private IPv4 address of the instance.
|
890
|
+
#
|
891
|
+
# * `product-code` - The product code associated with the AMI used to
|
892
|
+
# launch the instance.
|
893
|
+
#
|
894
|
+
# * `product-code.type` - The type of product code (`devpay` \|
|
895
|
+
# `marketplace`).
|
896
|
+
#
|
897
|
+
# * `ramdisk-id` - The RAM disk ID.
|
898
|
+
#
|
899
|
+
# * `reason` - The reason for the current state of the instance (for
|
900
|
+
# example, shows "User Initiated \[date\]" when you stop or
|
901
|
+
# terminate the instance). Similar to the state-reason-code filter.
|
902
|
+
#
|
903
|
+
# * `requester-id` - The ID of the entity that launched the instance on
|
904
|
+
# your behalf (for example, AWS Management Console, Auto Scaling, and
|
905
|
+
# so on).
|
906
|
+
#
|
907
|
+
# * `reservation-id` - The ID of the instance's reservation. A
|
908
|
+
# reservation ID is created any time you launch an instance. A
|
909
|
+
# reservation ID has a one-to-one relationship with an instance launch
|
910
|
+
# request, but can be associated with more than one instance if you
|
911
|
+
# launch multiple instances using the same launch request. For
|
912
|
+
# example, if you launch one instance, you'll get one reservation ID.
|
913
|
+
# If you launch ten instances using the same launch request, you'll
|
914
|
+
# also get one reservation ID.
|
915
|
+
#
|
916
|
+
# * `root-device-name` - The name of the root device for the instance
|
917
|
+
# (for example, `/dev/sda1` or `/dev/xvda`).
|
918
|
+
#
|
919
|
+
# * `root-device-type` - The type of root device that the instance uses
|
920
|
+
# (`ebs` \| `instance-store`).
|
921
|
+
#
|
922
|
+
# * `source-dest-check` - Indicates whether the instance performs
|
923
|
+
# source/destination checking. A value of `true` means that checking
|
924
|
+
# is enabled, and `false` means checking is disabled. The value must
|
925
|
+
# be `false` for the instance to perform network address translation
|
926
|
+
# (NAT) in your VPC.
|
927
|
+
#
|
928
|
+
# * `spot-instance-request-id` - The ID of the Spot instance request.
|
929
|
+
#
|
930
|
+
# * `state-reason-code` - The reason code for the state change.
|
931
|
+
#
|
932
|
+
# * `state-reason-message` - A message that describes the state change.
|
933
|
+
#
|
934
|
+
# * `subnet-id` - The ID of the subnet for the instance.
|
935
|
+
#
|
936
|
+
# * `tag`\:*key*=*value* - The key/value combination of a tag assigned
|
937
|
+
# to the resource. Specify the key of the tag in the filter name and
|
938
|
+
# the value of the tag in the filter value. For example, for the tag
|
939
|
+
# Purpose=X, specify `tag:Purpose` for the filter name and `X` for the
|
940
|
+
# filter value.
|
941
|
+
#
|
942
|
+
# * `tag-key` - The key of a tag assigned to the resource. This filter
|
943
|
+
# is independent of the `tag-value` filter. For example, if you use
|
944
|
+
# both the filter "tag-key=Purpose" and the filter "tag-value=X",
|
945
|
+
# you get any resources assigned both the tag key Purpose (regardless
|
946
|
+
# of what the tag's value is), and the tag value X (regardless of
|
947
|
+
# what the tag's key is). If you want to list only resources where
|
948
|
+
# Purpose is X, see the `tag`\:*key*=*value* filter.
|
949
|
+
#
|
950
|
+
# * `tag-value` - The value of a tag assigned to the resource. This
|
951
|
+
# filter is independent of the `tag-key` filter.
|
952
|
+
#
|
953
|
+
# * `tenancy` - The tenancy of an instance (`dedicated` \| `default` \|
|
954
|
+
# `host`).
|
955
|
+
#
|
956
|
+
# * `virtualization-type` - The virtualization type of the instance
|
957
|
+
# (`paravirtual` \| `hvm`).
|
958
|
+
#
|
959
|
+
# * `vpc-id` - The ID of the VPC that the instance is running in.
|
960
|
+
# @return [Instance::Collection]
|
961
|
+
def instances(options = {})
|
962
|
+
batches = Enumerator.new do |y|
|
963
|
+
options = Aws::Util.deep_merge(options, filters: [{
|
964
|
+
name: "vpc-id",
|
965
|
+
values: [@id]
|
966
|
+
}])
|
967
|
+
resp = @client.describe_instances(options)
|
968
|
+
resp.each_page do |page|
|
646
969
|
batch = []
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
data: v,
|
656
|
-
client: @client
|
657
|
-
)
|
970
|
+
page.data.reservations.each do |r|
|
971
|
+
r.instances.each do |i|
|
972
|
+
batch << Instance.new(
|
973
|
+
id: i.instance_id,
|
974
|
+
data: i,
|
975
|
+
client: @client
|
976
|
+
)
|
977
|
+
end
|
658
978
|
end
|
659
979
|
y.yield(batch)
|
660
980
|
end
|
661
|
-
VpcPeeringConnection::Collection.new(batches)
|
662
981
|
end
|
982
|
+
Instance::Collection.new(batches)
|
983
|
+
end
|
663
984
|
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
985
|
+
# @example Request syntax with placeholder values
|
986
|
+
#
|
987
|
+
# internet_gateways = vpc.internet_gateways({
|
988
|
+
# dry_run: false,
|
989
|
+
# internet_gateway_ids: ["String"],
|
990
|
+
# filters: [
|
991
|
+
# {
|
992
|
+
# name: "String",
|
993
|
+
# values: ["String"],
|
994
|
+
# },
|
995
|
+
# ],
|
996
|
+
# })
|
997
|
+
# @param [Hash] options ({})
|
998
|
+
# @option options [Boolean] :dry_run
|
999
|
+
# Checks whether you have the required permissions for the action,
|
1000
|
+
# without actually making the request, and provides an error response.
|
1001
|
+
# If you have the required permissions, the error response is
|
1002
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
1003
|
+
# @option options [Array<String>] :internet_gateway_ids
|
1004
|
+
# One or more Internet gateway IDs.
|
1005
|
+
#
|
1006
|
+
# Default: Describes all your Internet gateways.
|
1007
|
+
# @option options [Array<Types::Filter>] :filters
|
1008
|
+
# One or more filters.
|
1009
|
+
#
|
1010
|
+
# * `attachment.state` - The current state of the attachment between the
|
1011
|
+
# gateway and the VPC (`available`). Present only if a VPC is
|
1012
|
+
# attached.
|
1013
|
+
#
|
1014
|
+
# * `attachment.vpc-id` - The ID of an attached VPC.
|
1015
|
+
#
|
1016
|
+
# * `internet-gateway-id` - The ID of the Internet gateway.
|
1017
|
+
#
|
1018
|
+
# * `tag`\:*key*=*value* - The key/value combination of a tag assigned
|
1019
|
+
# to the resource. Specify the key of the tag in the filter name and
|
1020
|
+
# the value of the tag in the filter value. For example, for the tag
|
1021
|
+
# Purpose=X, specify `tag:Purpose` for the filter name and `X` for the
|
1022
|
+
# filter value.
|
1023
|
+
#
|
1024
|
+
# * `tag-key` - The key of a tag assigned to the resource. This filter
|
1025
|
+
# is independent of the `tag-value` filter. For example, if you use
|
1026
|
+
# both the filter "tag-key=Purpose" and the filter "tag-value=X",
|
1027
|
+
# you get any resources assigned both the tag key Purpose (regardless
|
1028
|
+
# of what the tag's value is), and the tag value X (regardless of
|
1029
|
+
# what the tag's key is). If you want to list only resources where
|
1030
|
+
# Purpose is X, see the `tag`\:*key*=*value* filter.
|
1031
|
+
#
|
1032
|
+
# * `tag-value` - The value of a tag assigned to the resource. This
|
1033
|
+
# filter is independent of the `tag-key` filter.
|
1034
|
+
# @return [InternetGateway::Collection]
|
1035
|
+
def internet_gateways(options = {})
|
1036
|
+
batches = Enumerator.new do |y|
|
1037
|
+
batch = []
|
1038
|
+
options = Aws::Util.deep_merge(options, filters: [{
|
1039
|
+
name: "attachment.vpc-id",
|
1040
|
+
values: [@id]
|
1041
|
+
}])
|
1042
|
+
resp = @client.describe_internet_gateways(options)
|
1043
|
+
resp.data.internet_gateways.each do |i|
|
1044
|
+
batch << InternetGateway.new(
|
1045
|
+
id: i.internet_gateway_id,
|
1046
|
+
data: i,
|
669
1047
|
client: @client
|
670
1048
|
)
|
671
|
-
else
|
672
|
-
nil
|
673
|
-
end
|
674
|
-
end
|
675
|
-
|
676
|
-
# @example Request syntax with placeholder values
|
677
|
-
#
|
678
|
-
# instances = vpc.instances({
|
679
|
-
# dry_run: false,
|
680
|
-
# instance_ids: ["String"],
|
681
|
-
# filters: [
|
682
|
-
# {
|
683
|
-
# name: "String",
|
684
|
-
# values: ["String"],
|
685
|
-
# },
|
686
|
-
# ],
|
687
|
-
# })
|
688
|
-
# @param [Hash] options ({})
|
689
|
-
# @option options [Boolean] :dry_run
|
690
|
-
# Checks whether you have the required permissions for the action,
|
691
|
-
# without actually making the request, and provides an error response.
|
692
|
-
# If you have the required permissions, the error response is
|
693
|
-
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
694
|
-
# @option options [Array<String>] :instance_ids
|
695
|
-
# One or more instance IDs.
|
696
|
-
#
|
697
|
-
# Default: Describes all your instances.
|
698
|
-
# @option options [Array<Types::Filter>] :filters
|
699
|
-
# One or more filters.
|
700
|
-
#
|
701
|
-
# * `affinity` - The affinity setting for an instance running on a
|
702
|
-
# Dedicated Host (`default` \| `host`).
|
703
|
-
#
|
704
|
-
# * `architecture` - The instance architecture (`i386` \| `x86_64`).
|
705
|
-
#
|
706
|
-
# * `association.public-ip` - The address of the Elastic IP address
|
707
|
-
# (IPv4) bound to the network interface.
|
708
|
-
#
|
709
|
-
# * `association.ip-owner-id` - The owner of the Elastic IP address
|
710
|
-
# (IPv4) associated with the network interface.
|
711
|
-
#
|
712
|
-
# * `association.allocation-id` - The allocation ID returned when you
|
713
|
-
# allocated the Elastic IP address (IPv4) for your network interface.
|
714
|
-
#
|
715
|
-
# * `association.association-id` - The association ID returned when the
|
716
|
-
# network interface was associated with an IPv4 address.
|
717
|
-
#
|
718
|
-
# * `availability-zone` - The Availability Zone of the instance.
|
719
|
-
#
|
720
|
-
# * `block-device-mapping.attach-time` - The attach time for an EBS
|
721
|
-
# volume mapped to the instance, for example,
|
722
|
-
# `2010-09-15T17:15:20.000Z`.
|
723
|
-
#
|
724
|
-
# * `block-device-mapping.delete-on-termination` - A Boolean that
|
725
|
-
# indicates whether the EBS volume is deleted on instance termination.
|
726
|
-
#
|
727
|
-
# * `block-device-mapping.device-name` - The device name for the EBS
|
728
|
-
# volume (for example, `/dev/sdh` or `xvdh`).
|
729
|
-
#
|
730
|
-
# * `block-device-mapping.status` - The status for the EBS volume
|
731
|
-
# (`attaching` \| `attached` \| `detaching` \| `detached`).
|
732
|
-
#
|
733
|
-
# * `block-device-mapping.volume-id` - The volume ID of the EBS volume.
|
734
|
-
#
|
735
|
-
# * `client-token` - The idempotency token you provided when you
|
736
|
-
# launched the instance.
|
737
|
-
#
|
738
|
-
# * `dns-name` - The public DNS name of the instance.
|
739
|
-
#
|
740
|
-
# * `group-id` - The ID of the security group for the instance.
|
741
|
-
# EC2-Classic only.
|
742
|
-
#
|
743
|
-
# * `group-name` - The name of the security group for the instance.
|
744
|
-
# EC2-Classic only.
|
745
|
-
#
|
746
|
-
# * `host-id` - The ID of the Dedicated Host on which the instance is
|
747
|
-
# running, if applicable.
|
748
|
-
#
|
749
|
-
# * `hypervisor` - The hypervisor type of the instance (`ovm` \| `xen`).
|
750
|
-
#
|
751
|
-
# * `iam-instance-profile.arn` - The instance profile associated with
|
752
|
-
# the instance. Specified as an ARN.
|
753
|
-
#
|
754
|
-
# * `image-id` - The ID of the image used to launch the instance.
|
755
|
-
#
|
756
|
-
# * `instance-id` - The ID of the instance.
|
757
|
-
#
|
758
|
-
# * `instance-lifecycle` - Indicates whether this is a Spot Instance or
|
759
|
-
# a Scheduled Instance (`spot` \| `scheduled`).
|
760
|
-
#
|
761
|
-
# * `instance-state-code` - The state of the instance, as a 16-bit
|
762
|
-
# unsigned integer. The high byte is an opaque internal value and
|
763
|
-
# should be ignored. The low byte is set based on the state
|
764
|
-
# represented. The valid values are: 0 (pending), 16 (running), 32
|
765
|
-
# (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped).
|
766
|
-
#
|
767
|
-
# * `instance-state-name` - The state of the instance (`pending` \|
|
768
|
-
# `running` \| `shutting-down` \| `terminated` \| `stopping` \|
|
769
|
-
# `stopped`).
|
770
|
-
#
|
771
|
-
# * `instance-type` - The type of instance (for example, `t2.micro`).
|
772
|
-
#
|
773
|
-
# * `instance.group-id` - The ID of the security group for the instance.
|
774
|
-
#
|
775
|
-
# * `instance.group-name` - The name of the security group for the
|
776
|
-
# instance.
|
777
|
-
#
|
778
|
-
# * `ip-address` - The public IPv4 address of the instance.
|
779
|
-
#
|
780
|
-
# * `kernel-id` - The kernel ID.
|
781
|
-
#
|
782
|
-
# * `key-name` - The name of the key pair used when the instance was
|
783
|
-
# launched.
|
784
|
-
#
|
785
|
-
# * `launch-index` - When launching multiple instances, this is the
|
786
|
-
# index for the instance in the launch group (for example, 0, 1, 2,
|
787
|
-
# and so on).
|
788
|
-
#
|
789
|
-
# * `launch-time` - The time when the instance was launched.
|
790
|
-
#
|
791
|
-
# * `monitoring-state` - Indicates whether detailed monitoring is
|
792
|
-
# enabled (`disabled` \| `enabled`).
|
793
|
-
#
|
794
|
-
# * `network-interface.addresses.private-ip-address` - The private IPv4
|
795
|
-
# address associated with the network interface.
|
796
|
-
#
|
797
|
-
# * `network-interface.addresses.primary` - Specifies whether the IPv4
|
798
|
-
# address of the network interface is the primary private IPv4
|
799
|
-
# address.
|
800
|
-
#
|
801
|
-
# * `network-interface.addresses.association.public-ip` - The ID of the
|
802
|
-
# association of an Elastic IP address (IPv4) with a network
|
803
|
-
# interface.
|
804
|
-
#
|
805
|
-
# * `network-interface.addresses.association.ip-owner-id` - The owner ID
|
806
|
-
# of the private IPv4 address associated with the network interface.
|
807
|
-
#
|
808
|
-
# * `network-interface.attachment.attachment-id` - The ID of the
|
809
|
-
# interface attachment.
|
810
|
-
#
|
811
|
-
# * `network-interface.attachment.instance-id` - The ID of the instance
|
812
|
-
# to which the network interface is attached.
|
813
|
-
#
|
814
|
-
# * `network-interface.attachment.instance-owner-id` - The owner ID of
|
815
|
-
# the instance to which the network interface is attached.
|
816
|
-
#
|
817
|
-
# * `network-interface.attachment.device-index` - The device index to
|
818
|
-
# which the network interface is attached.
|
819
|
-
#
|
820
|
-
# * `network-interface.attachment.status` - The status of the attachment
|
821
|
-
# (`attaching` \| `attached` \| `detaching` \| `detached`).
|
822
|
-
#
|
823
|
-
# * `network-interface.attachment.attach-time` - The time that the
|
824
|
-
# network interface was attached to an instance.
|
825
|
-
#
|
826
|
-
# * `network-interface.attachment.delete-on-termination` - Specifies
|
827
|
-
# whether the attachment is deleted when an instance is terminated.
|
828
|
-
#
|
829
|
-
# * `network-interface.availability-zone` - The Availability Zone for
|
830
|
-
# the network interface.
|
831
|
-
#
|
832
|
-
# * `network-interface.description` - The description of the network
|
833
|
-
# interface.
|
834
|
-
#
|
835
|
-
# * `network-interface.group-id` - The ID of a security group associated
|
836
|
-
# with the network interface.
|
837
|
-
#
|
838
|
-
# * `network-interface.group-name` - The name of a security group
|
839
|
-
# associated with the network interface.
|
840
|
-
#
|
841
|
-
# * `network-interface.ipv6-addresses.ipv6-address` - The IPv6 address
|
842
|
-
# associated with the network interface.
|
843
|
-
#
|
844
|
-
# * `network-interface.mac-address` - The MAC address of the network
|
845
|
-
# interface.
|
846
|
-
#
|
847
|
-
# * `network-interface.network-interface-id` - The ID of the network
|
848
|
-
# interface.
|
849
|
-
#
|
850
|
-
# * `network-interface.owner-id` - The ID of the owner of the network
|
851
|
-
# interface.
|
852
|
-
#
|
853
|
-
# * `network-interface.private-dns-name` - The private DNS name of the
|
854
|
-
# network interface.
|
855
|
-
#
|
856
|
-
# * `network-interface.requester-id` - The requester ID for the network
|
857
|
-
# interface.
|
858
|
-
#
|
859
|
-
# * `network-interface.requester-managed` - Indicates whether the
|
860
|
-
# network interface is being managed by AWS.
|
861
|
-
#
|
862
|
-
# * `network-interface.status` - The status of the network interface
|
863
|
-
# (`available`) \| `in-use`).
|
864
|
-
#
|
865
|
-
# * `network-interface.source-dest-check` - Whether the network
|
866
|
-
# interface performs source/destination checking. A value of `true`
|
867
|
-
# means checking is enabled, and `false` means checking is disabled.
|
868
|
-
# The value must be `false` for the network interface to perform
|
869
|
-
# network address translation (NAT) in your VPC.
|
870
|
-
#
|
871
|
-
# * `network-interface.subnet-id` - The ID of the subnet for the network
|
872
|
-
# interface.
|
873
|
-
#
|
874
|
-
# * `network-interface.vpc-id` - The ID of the VPC for the network
|
875
|
-
# interface.
|
876
|
-
#
|
877
|
-
# * `owner-id` - The AWS account ID of the instance owner.
|
878
|
-
#
|
879
|
-
# * `placement-group-name` - The name of the placement group for the
|
880
|
-
# instance.
|
881
|
-
#
|
882
|
-
# * `platform` - The platform. Use `windows` if you have Windows
|
883
|
-
# instances; otherwise, leave blank.
|
884
|
-
#
|
885
|
-
# * `private-dns-name` - The private IPv4 DNS name of the instance.
|
886
|
-
#
|
887
|
-
# * `private-ip-address` - The private IPv4 address of the instance.
|
888
|
-
#
|
889
|
-
# * `product-code` - The product code associated with the AMI used to
|
890
|
-
# launch the instance.
|
891
|
-
#
|
892
|
-
# * `product-code.type` - The type of product code (`devpay` \|
|
893
|
-
# `marketplace`).
|
894
|
-
#
|
895
|
-
# * `ramdisk-id` - The RAM disk ID.
|
896
|
-
#
|
897
|
-
# * `reason` - The reason for the current state of the instance (for
|
898
|
-
# example, shows "User Initiated \[date\]" when you stop or
|
899
|
-
# terminate the instance). Similar to the state-reason-code filter.
|
900
|
-
#
|
901
|
-
# * `requester-id` - The ID of the entity that launched the instance on
|
902
|
-
# your behalf (for example, AWS Management Console, Auto Scaling, and
|
903
|
-
# so on).
|
904
|
-
#
|
905
|
-
# * `reservation-id` - The ID of the instance's reservation. A
|
906
|
-
# reservation ID is created any time you launch an instance. A
|
907
|
-
# reservation ID has a one-to-one relationship with an instance launch
|
908
|
-
# request, but can be associated with more than one instance if you
|
909
|
-
# launch multiple instances using the same launch request. For
|
910
|
-
# example, if you launch one instance, you'll get one reservation ID.
|
911
|
-
# If you launch ten instances using the same launch request, you'll
|
912
|
-
# also get one reservation ID.
|
913
|
-
#
|
914
|
-
# * `root-device-name` - The name of the root device for the instance
|
915
|
-
# (for example, `/dev/sda1` or `/dev/xvda`).
|
916
|
-
#
|
917
|
-
# * `root-device-type` - The type of root device that the instance uses
|
918
|
-
# (`ebs` \| `instance-store`).
|
919
|
-
#
|
920
|
-
# * `source-dest-check` - Indicates whether the instance performs
|
921
|
-
# source/destination checking. A value of `true` means that checking
|
922
|
-
# is enabled, and `false` means checking is disabled. The value must
|
923
|
-
# be `false` for the instance to perform network address translation
|
924
|
-
# (NAT) in your VPC.
|
925
|
-
#
|
926
|
-
# * `spot-instance-request-id` - The ID of the Spot instance request.
|
927
|
-
#
|
928
|
-
# * `state-reason-code` - The reason code for the state change.
|
929
|
-
#
|
930
|
-
# * `state-reason-message` - A message that describes the state change.
|
931
|
-
#
|
932
|
-
# * `subnet-id` - The ID of the subnet for the instance.
|
933
|
-
#
|
934
|
-
# * `tag`\:*key*=*value* - The key/value combination of a tag assigned
|
935
|
-
# to the resource, where `tag`\:*key* is the tag's key.
|
936
|
-
#
|
937
|
-
# * `tag-key` - The key of a tag assigned to the resource. This filter
|
938
|
-
# is independent of the `tag-value` filter. For example, if you use
|
939
|
-
# both the filter "tag-key=Purpose" and the filter "tag-value=X",
|
940
|
-
# you get any resources assigned both the tag key Purpose (regardless
|
941
|
-
# of what the tag's value is), and the tag value X (regardless of
|
942
|
-
# what the tag's key is). If you want to list only resources where
|
943
|
-
# Purpose is X, see the `tag`\:*key*=*value* filter.
|
944
|
-
#
|
945
|
-
# * `tag-value` - The value of a tag assigned to the resource. This
|
946
|
-
# filter is independent of the `tag-key` filter.
|
947
|
-
#
|
948
|
-
# * `tenancy` - The tenancy of an instance (`dedicated` \| `default` \|
|
949
|
-
# `host`).
|
950
|
-
#
|
951
|
-
# * `virtualization-type` - The virtualization type of the instance
|
952
|
-
# (`paravirtual` \| `hvm`).
|
953
|
-
#
|
954
|
-
# * `vpc-id` - The ID of the VPC that the instance is running in.
|
955
|
-
# @return [Instance::Collection]
|
956
|
-
def instances(options = {})
|
957
|
-
batches = Enumerator.new do |y|
|
958
|
-
options = Aws::Util.deep_merge(options, filters: [{
|
959
|
-
name: "vpc-id",
|
960
|
-
values: [@id]
|
961
|
-
}])
|
962
|
-
resp = @client.describe_instances(options)
|
963
|
-
resp.each_page do |page|
|
964
|
-
batch = []
|
965
|
-
page.data.reservations.each do |r|
|
966
|
-
r.instances.each do |i|
|
967
|
-
batch << Instance.new(
|
968
|
-
id: i.instance_id,
|
969
|
-
data: i,
|
970
|
-
client: @client
|
971
|
-
)
|
972
|
-
end
|
973
|
-
end
|
974
|
-
y.yield(batch)
|
975
|
-
end
|
976
|
-
end
|
977
|
-
Instance::Collection.new(batches)
|
978
|
-
end
|
979
|
-
|
980
|
-
# @example Request syntax with placeholder values
|
981
|
-
#
|
982
|
-
# internetgateways = vpc.internet_gateways({
|
983
|
-
# dry_run: false,
|
984
|
-
# internet_gateway_ids: ["String"],
|
985
|
-
# filters: [
|
986
|
-
# {
|
987
|
-
# name: "String",
|
988
|
-
# values: ["String"],
|
989
|
-
# },
|
990
|
-
# ],
|
991
|
-
# })
|
992
|
-
# @param [Hash] options ({})
|
993
|
-
# @option options [Boolean] :dry_run
|
994
|
-
# Checks whether you have the required permissions for the action,
|
995
|
-
# without actually making the request, and provides an error response.
|
996
|
-
# If you have the required permissions, the error response is
|
997
|
-
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
998
|
-
# @option options [Array<String>] :internet_gateway_ids
|
999
|
-
# One or more Internet gateway IDs.
|
1000
|
-
#
|
1001
|
-
# Default: Describes all your Internet gateways.
|
1002
|
-
# @option options [Array<Types::Filter>] :filters
|
1003
|
-
# One or more filters.
|
1004
|
-
#
|
1005
|
-
# * `attachment.state` - The current state of the attachment between the
|
1006
|
-
# gateway and the VPC (`available`). Present only if a VPC is
|
1007
|
-
# attached.
|
1008
|
-
#
|
1009
|
-
# * `attachment.vpc-id` - The ID of an attached VPC.
|
1010
|
-
#
|
1011
|
-
# * `internet-gateway-id` - The ID of the Internet gateway.
|
1012
|
-
#
|
1013
|
-
# * `tag`\:*key*=*value* - The key/value combination of a tag assigned
|
1014
|
-
# to the resource.
|
1015
|
-
#
|
1016
|
-
# * `tag-key` - The key of a tag assigned to the resource. This filter
|
1017
|
-
# is independent of the `tag-value` filter. For example, if you use
|
1018
|
-
# both the filter "tag-key=Purpose" and the filter "tag-value=X",
|
1019
|
-
# you get any resources assigned both the tag key Purpose (regardless
|
1020
|
-
# of what the tag's value is), and the tag value X (regardless of
|
1021
|
-
# what the tag's key is). If you want to list only resources where
|
1022
|
-
# Purpose is X, see the `tag`\:*key*=*value* filter.
|
1023
|
-
#
|
1024
|
-
# * `tag-value` - The value of a tag assigned to the resource. This
|
1025
|
-
# filter is independent of the `tag-key` filter.
|
1026
|
-
# @return [InternetGateway::Collection]
|
1027
|
-
def internet_gateways(options = {})
|
1028
|
-
batches = Enumerator.new do |y|
|
1029
|
-
batch = []
|
1030
|
-
options = Aws::Util.deep_merge(options, filters: [{
|
1031
|
-
name: "attachment.vpc-id",
|
1032
|
-
values: [@id]
|
1033
|
-
}])
|
1034
|
-
resp = @client.describe_internet_gateways(options)
|
1035
|
-
resp.data.internet_gateways.each do |i|
|
1036
|
-
batch << InternetGateway.new(
|
1037
|
-
id: i.internet_gateway_id,
|
1038
|
-
data: i,
|
1039
|
-
client: @client
|
1040
|
-
)
|
1041
|
-
end
|
1042
|
-
y.yield(batch)
|
1043
1049
|
end
|
1044
|
-
|
1050
|
+
y.yield(batch)
|
1045
1051
|
end
|
1052
|
+
InternetGateway::Collection.new(batches)
|
1053
|
+
end
|
1046
1054
|
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1055
|
+
# @example Request syntax with placeholder values
|
1056
|
+
#
|
1057
|
+
# network_acls = vpc.network_acls({
|
1058
|
+
# dry_run: false,
|
1059
|
+
# network_acl_ids: ["String"],
|
1060
|
+
# filters: [
|
1061
|
+
# {
|
1062
|
+
# name: "String",
|
1063
|
+
# values: ["String"],
|
1064
|
+
# },
|
1065
|
+
# ],
|
1066
|
+
# })
|
1067
|
+
# @param [Hash] options ({})
|
1068
|
+
# @option options [Boolean] :dry_run
|
1069
|
+
# Checks whether you have the required permissions for the action,
|
1070
|
+
# without actually making the request, and provides an error response.
|
1071
|
+
# If you have the required permissions, the error response is
|
1072
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
1073
|
+
# @option options [Array<String>] :network_acl_ids
|
1074
|
+
# One or more network ACL IDs.
|
1075
|
+
#
|
1076
|
+
# Default: Describes all your network ACLs.
|
1077
|
+
# @option options [Array<Types::Filter>] :filters
|
1078
|
+
# One or more filters.
|
1079
|
+
#
|
1080
|
+
# * `association.association-id` - The ID of an association ID for the
|
1081
|
+
# ACL.
|
1082
|
+
#
|
1083
|
+
# * `association.network-acl-id` - The ID of the network ACL involved in
|
1084
|
+
# the association.
|
1085
|
+
#
|
1086
|
+
# * `association.subnet-id` - The ID of the subnet involved in the
|
1087
|
+
# association.
|
1088
|
+
#
|
1089
|
+
# * `default` - Indicates whether the ACL is the default network ACL for
|
1090
|
+
# the VPC.
|
1091
|
+
#
|
1092
|
+
# * `entry.cidr` - The IPv4 CIDR range specified in the entry.
|
1093
|
+
#
|
1094
|
+
# * `entry.egress` - Indicates whether the entry applies to egress
|
1095
|
+
# traffic.
|
1096
|
+
#
|
1097
|
+
# * `entry.icmp.code` - The ICMP code specified in the entry, if any.
|
1098
|
+
#
|
1099
|
+
# * `entry.icmp.type` - The ICMP type specified in the entry, if any.
|
1100
|
+
#
|
1101
|
+
# * `entry.ipv6-cidr` - The IPv6 CIDR range specified in the entry.
|
1102
|
+
#
|
1103
|
+
# * `entry.port-range.from` - The start of the port range specified in
|
1104
|
+
# the entry.
|
1105
|
+
#
|
1106
|
+
# * `entry.port-range.to` - The end of the port range specified in the
|
1107
|
+
# entry.
|
1108
|
+
#
|
1109
|
+
# * `entry.protocol` - The protocol specified in the entry (`tcp` \|
|
1110
|
+
# `udp` \| `icmp` or a protocol number).
|
1111
|
+
#
|
1112
|
+
# * `entry.rule-action` - Allows or denies the matching traffic (`allow`
|
1113
|
+
# \| `deny`).
|
1114
|
+
#
|
1115
|
+
# * `entry.rule-number` - The number of an entry (in other words, rule)
|
1116
|
+
# in the ACL's set of entries.
|
1117
|
+
#
|
1118
|
+
# * `network-acl-id` - The ID of the network ACL.
|
1119
|
+
#
|
1120
|
+
# * `tag`\:*key*=*value* - The key/value combination of a tag assigned
|
1121
|
+
# to the resource. Specify the key of the tag in the filter name and
|
1122
|
+
# the value of the tag in the filter value. For example, for the tag
|
1123
|
+
# Purpose=X, specify `tag:Purpose` for the filter name and `X` for the
|
1124
|
+
# filter value.
|
1125
|
+
#
|
1126
|
+
# * `tag-key` - The key of a tag assigned to the resource. This filter
|
1127
|
+
# is independent of the `tag-value` filter. For example, if you use
|
1128
|
+
# both the filter "tag-key=Purpose" and the filter "tag-value=X",
|
1129
|
+
# you get any resources assigned both the tag key Purpose (regardless
|
1130
|
+
# of what the tag's value is), and the tag value X (regardless of
|
1131
|
+
# what the tag's key is). If you want to list only resources where
|
1132
|
+
# Purpose is X, see the `tag`\:*key*=*value* filter.
|
1133
|
+
#
|
1134
|
+
# * `tag-value` - The value of a tag assigned to the resource. This
|
1135
|
+
# filter is independent of the `tag-key` filter.
|
1136
|
+
#
|
1137
|
+
# * `vpc-id` - The ID of the VPC for the network ACL.
|
1138
|
+
# @return [NetworkAcl::Collection]
|
1139
|
+
def network_acls(options = {})
|
1140
|
+
batches = Enumerator.new do |y|
|
1141
|
+
batch = []
|
1142
|
+
options = Aws::Util.deep_merge(options, filters: [{
|
1143
|
+
name: "vpc-id",
|
1144
|
+
values: [@id]
|
1145
|
+
}])
|
1146
|
+
resp = @client.describe_network_acls(options)
|
1147
|
+
resp.data.network_acls.each do |n|
|
1148
|
+
batch << NetworkAcl.new(
|
1149
|
+
id: n.network_acl_id,
|
1150
|
+
data: n,
|
1151
|
+
client: @client
|
1152
|
+
)
|
1144
1153
|
end
|
1145
|
-
|
1154
|
+
y.yield(batch)
|
1146
1155
|
end
|
1156
|
+
NetworkAcl::Collection.new(batches)
|
1157
|
+
end
|
1147
1158
|
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1159
|
+
# @example Request syntax with placeholder values
|
1160
|
+
#
|
1161
|
+
# network_interfaces = vpc.network_interfaces({
|
1162
|
+
# dry_run: false,
|
1163
|
+
# network_interface_ids: ["String"],
|
1164
|
+
# filters: [
|
1165
|
+
# {
|
1166
|
+
# name: "String",
|
1167
|
+
# values: ["String"],
|
1168
|
+
# },
|
1169
|
+
# ],
|
1170
|
+
# })
|
1171
|
+
# @param [Hash] options ({})
|
1172
|
+
# @option options [Boolean] :dry_run
|
1173
|
+
# Checks whether you have the required permissions for the action,
|
1174
|
+
# without actually making the request, and provides an error response.
|
1175
|
+
# If you have the required permissions, the error response is
|
1176
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
1177
|
+
# @option options [Array<String>] :network_interface_ids
|
1178
|
+
# One or more network interface IDs.
|
1179
|
+
#
|
1180
|
+
# Default: Describes all your network interfaces.
|
1181
|
+
# @option options [Array<Types::Filter>] :filters
|
1182
|
+
# One or more filters.
|
1183
|
+
#
|
1184
|
+
# * `addresses.private-ip-address` - The private IPv4 addresses
|
1185
|
+
# associated with the network interface.
|
1186
|
+
#
|
1187
|
+
# * `addresses.primary` - Whether the private IPv4 address is the
|
1188
|
+
# primary IP address associated with the network interface.
|
1189
|
+
#
|
1190
|
+
# * `addresses.association.public-ip` - The association ID returned when
|
1191
|
+
# the network interface was associated with the Elastic IP address
|
1192
|
+
# (IPv4).
|
1193
|
+
#
|
1194
|
+
# * `addresses.association.owner-id` - The owner ID of the addresses
|
1195
|
+
# associated with the network interface.
|
1196
|
+
#
|
1197
|
+
# * `association.association-id` - The association ID returned when the
|
1198
|
+
# network interface was associated with an IPv4 address.
|
1199
|
+
#
|
1200
|
+
# * `association.allocation-id` - The allocation ID returned when you
|
1201
|
+
# allocated the Elastic IP address (IPv4) for your network interface.
|
1202
|
+
#
|
1203
|
+
# * `association.ip-owner-id` - The owner of the Elastic IP address
|
1204
|
+
# (IPv4) associated with the network interface.
|
1205
|
+
#
|
1206
|
+
# * `association.public-ip` - The address of the Elastic IP address
|
1207
|
+
# (IPv4) bound to the network interface.
|
1208
|
+
#
|
1209
|
+
# * `association.public-dns-name` - The public DNS name for the network
|
1210
|
+
# interface (IPv4).
|
1211
|
+
#
|
1212
|
+
# * `attachment.attachment-id` - The ID of the interface attachment.
|
1213
|
+
#
|
1214
|
+
# * `attachment.attach.time` - The time that the network interface was
|
1215
|
+
# attached to an instance.
|
1216
|
+
#
|
1217
|
+
# * `attachment.delete-on-termination` - Indicates whether the
|
1218
|
+
# attachment is deleted when an instance is terminated.
|
1219
|
+
#
|
1220
|
+
# * `attachment.device-index` - The device index to which the network
|
1221
|
+
# interface is attached.
|
1222
|
+
#
|
1223
|
+
# * `attachment.instance-id` - The ID of the instance to which the
|
1224
|
+
# network interface is attached.
|
1225
|
+
#
|
1226
|
+
# * `attachment.instance-owner-id` - The owner ID of the instance to
|
1227
|
+
# which the network interface is attached.
|
1228
|
+
#
|
1229
|
+
# * `attachment.nat-gateway-id` - The ID of the NAT gateway to which the
|
1230
|
+
# network interface is attached.
|
1231
|
+
#
|
1232
|
+
# * `attachment.status` - The status of the attachment (`attaching` \|
|
1233
|
+
# `attached` \| `detaching` \| `detached`).
|
1234
|
+
#
|
1235
|
+
# * `availability-zone` - The Availability Zone of the network
|
1236
|
+
# interface.
|
1237
|
+
#
|
1238
|
+
# * `description` - The description of the network interface.
|
1239
|
+
#
|
1240
|
+
# * `group-id` - The ID of a security group associated with the network
|
1241
|
+
# interface.
|
1242
|
+
#
|
1243
|
+
# * `group-name` - The name of a security group associated with the
|
1244
|
+
# network interface.
|
1245
|
+
#
|
1246
|
+
# * `ipv6-addresses.ipv6-address` - An IPv6 address associated with the
|
1247
|
+
# network interface.
|
1248
|
+
#
|
1249
|
+
# * `mac-address` - The MAC address of the network interface.
|
1250
|
+
#
|
1251
|
+
# * `network-interface-id` - The ID of the network interface.
|
1252
|
+
#
|
1253
|
+
# * `owner-id` - The AWS account ID of the network interface owner.
|
1254
|
+
#
|
1255
|
+
# * `private-ip-address` - The private IPv4 address or addresses of the
|
1256
|
+
# network interface.
|
1257
|
+
#
|
1258
|
+
# * `private-dns-name` - The private DNS name of the network interface
|
1259
|
+
# (IPv4).
|
1260
|
+
#
|
1261
|
+
# * `requester-id` - The ID of the entity that launched the instance on
|
1262
|
+
# your behalf (for example, AWS Management Console, Auto Scaling, and
|
1263
|
+
# so on).
|
1264
|
+
#
|
1265
|
+
# * `requester-managed` - Indicates whether the network interface is
|
1266
|
+
# being managed by an AWS service (for example, AWS Management
|
1267
|
+
# Console, Auto Scaling, and so on).
|
1268
|
+
#
|
1269
|
+
# * `source-desk-check` - Indicates whether the network interface
|
1270
|
+
# performs source/destination checking. A value of `true` means
|
1271
|
+
# checking is enabled, and `false` means checking is disabled. The
|
1272
|
+
# value must be `false` for the network interface to perform network
|
1273
|
+
# address translation (NAT) in your VPC.
|
1274
|
+
#
|
1275
|
+
# * `status` - The status of the network interface. If the network
|
1276
|
+
# interface is not attached to an instance, the status is `available`;
|
1277
|
+
# if a network interface is attached to an instance the status is
|
1278
|
+
# `in-use`.
|
1279
|
+
#
|
1280
|
+
# * `subnet-id` - The ID of the subnet for the network interface.
|
1281
|
+
#
|
1282
|
+
# * `tag`\:*key*=*value* - The key/value combination of a tag assigned
|
1283
|
+
# to the resource. Specify the key of the tag in the filter name and
|
1284
|
+
# the value of the tag in the filter value. For example, for the tag
|
1285
|
+
# Purpose=X, specify `tag:Purpose` for the filter name and `X` for the
|
1286
|
+
# filter value.
|
1287
|
+
#
|
1288
|
+
# * `tag-key` - The key of a tag assigned to the resource. This filter
|
1289
|
+
# is independent of the `tag-value` filter. For example, if you use
|
1290
|
+
# both the filter "tag-key=Purpose" and the filter "tag-value=X",
|
1291
|
+
# you get any resources assigned both the tag key Purpose (regardless
|
1292
|
+
# of what the tag's value is), and the tag value X (regardless of
|
1293
|
+
# what the tag's key is). If you want to list only resources where
|
1294
|
+
# Purpose is X, see the `tag`\:*key*=*value* filter.
|
1295
|
+
#
|
1296
|
+
# * `tag-value` - The value of a tag assigned to the resource. This
|
1297
|
+
# filter is independent of the `tag-key` filter.
|
1298
|
+
#
|
1299
|
+
# * `vpc-id` - The ID of the VPC for the network interface.
|
1300
|
+
# @return [NetworkInterface::Collection]
|
1301
|
+
def network_interfaces(options = {})
|
1302
|
+
batches = Enumerator.new do |y|
|
1303
|
+
batch = []
|
1304
|
+
options = Aws::Util.deep_merge(options, filters: [{
|
1305
|
+
name: "vpc-id",
|
1306
|
+
values: [@id]
|
1307
|
+
}])
|
1308
|
+
resp = @client.describe_network_interfaces(options)
|
1309
|
+
resp.data.network_interfaces.each do |n|
|
1310
|
+
batch << NetworkInterface.new(
|
1311
|
+
id: n.network_interface_id,
|
1312
|
+
data: n,
|
1313
|
+
client: @client
|
1314
|
+
)
|
1303
1315
|
end
|
1304
|
-
|
1316
|
+
y.yield(batch)
|
1305
1317
|
end
|
1318
|
+
NetworkInterface::Collection.new(batches)
|
1319
|
+
end
|
1306
1320
|
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1321
|
+
# @example Request syntax with placeholder values
|
1322
|
+
#
|
1323
|
+
# requested_vpc_peering_connections = vpc.requested_vpc_peering_connections({
|
1324
|
+
# dry_run: false,
|
1325
|
+
# vpc_peering_connection_ids: ["String"],
|
1326
|
+
# filters: [
|
1327
|
+
# {
|
1328
|
+
# name: "String",
|
1329
|
+
# values: ["String"],
|
1330
|
+
# },
|
1331
|
+
# ],
|
1332
|
+
# })
|
1333
|
+
# @param [Hash] options ({})
|
1334
|
+
# @option options [Boolean] :dry_run
|
1335
|
+
# Checks whether you have the required permissions for the action,
|
1336
|
+
# without actually making the request, and provides an error response.
|
1337
|
+
# If you have the required permissions, the error response is
|
1338
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
1339
|
+
# @option options [Array<String>] :vpc_peering_connection_ids
|
1340
|
+
# One or more VPC peering connection IDs.
|
1341
|
+
#
|
1342
|
+
# Default: Describes all your VPC peering connections.
|
1343
|
+
# @option options [Array<Types::Filter>] :filters
|
1344
|
+
# One or more filters.
|
1345
|
+
#
|
1346
|
+
# * `accepter-vpc-info.cidr-block` - The IPv4 CIDR block of the peer
|
1347
|
+
# VPC.
|
1348
|
+
#
|
1349
|
+
# * `accepter-vpc-info.owner-id` - The AWS account ID of the owner of
|
1350
|
+
# the peer VPC.
|
1351
|
+
#
|
1352
|
+
# * `accepter-vpc-info.vpc-id` - The ID of the peer VPC.
|
1353
|
+
#
|
1354
|
+
# * `expiration-time` - The expiration date and time for the VPC peering
|
1355
|
+
# connection.
|
1356
|
+
#
|
1357
|
+
# * `requester-vpc-info.cidr-block` - The IPv4 CIDR block of the
|
1358
|
+
# requester's VPC.
|
1359
|
+
#
|
1360
|
+
# * `requester-vpc-info.owner-id` - The AWS account ID of the owner of
|
1361
|
+
# the requester VPC.
|
1362
|
+
#
|
1363
|
+
# * `requester-vpc-info.vpc-id` - The ID of the requester VPC.
|
1364
|
+
#
|
1365
|
+
# * `status-code` - The status of the VPC peering connection
|
1366
|
+
# (`pending-acceptance` \| `failed` \| `expired` \| `provisioning` \|
|
1367
|
+
# `active` \| `deleted` \| `rejected`).
|
1368
|
+
#
|
1369
|
+
# * `status-message` - A message that provides more information about
|
1370
|
+
# the status of the VPC peering connection, if applicable.
|
1371
|
+
#
|
1372
|
+
# * `tag`\:*key*=*value* - The key/value combination of a tag assigned
|
1373
|
+
# to the resource. Specify the key of the tag in the filter name and
|
1374
|
+
# the value of the tag in the filter value. For example, for the tag
|
1375
|
+
# Purpose=X, specify `tag:Purpose` for the filter name and `X` for the
|
1376
|
+
# filter value.
|
1377
|
+
#
|
1378
|
+
# * `tag-key` - The key of a tag assigned to the resource. This filter
|
1379
|
+
# is independent of the `tag-value` filter. For example, if you use
|
1380
|
+
# both the filter "tag-key=Purpose" and the filter "tag-value=X",
|
1381
|
+
# you get any resources assigned both the tag key Purpose (regardless
|
1382
|
+
# of what the tag's value is), and the tag value X (regardless of
|
1383
|
+
# what the tag's key is). If you want to list only resources where
|
1384
|
+
# Purpose is X, see the `tag`\:*key*=*value* filter.
|
1385
|
+
#
|
1386
|
+
# * `tag-value` - The value of a tag assigned to the resource. This
|
1387
|
+
# filter is independent of the `tag-key` filter.
|
1388
|
+
#
|
1389
|
+
# * `vpc-peering-connection-id` - The ID of the VPC peering connection.
|
1390
|
+
# @return [VpcPeeringConnection::Collection]
|
1391
|
+
def requested_vpc_peering_connections(options = {})
|
1392
|
+
batches = Enumerator.new do |y|
|
1393
|
+
batch = []
|
1394
|
+
options = Aws::Util.deep_merge(options, filters: [{
|
1395
|
+
name: "requester-vpc-info.vpc-id",
|
1396
|
+
values: [@id]
|
1397
|
+
}])
|
1398
|
+
resp = @client.describe_vpc_peering_connections(options)
|
1399
|
+
resp.data.vpc_peering_connections.each do |v|
|
1400
|
+
batch << VpcPeeringConnection.new(
|
1401
|
+
id: v.vpc_peering_connection_id,
|
1402
|
+
data: v,
|
1403
|
+
client: @client
|
1404
|
+
)
|
1390
1405
|
end
|
1391
|
-
|
1406
|
+
y.yield(batch)
|
1392
1407
|
end
|
1408
|
+
VpcPeeringConnection::Collection.new(batches)
|
1409
|
+
end
|
1393
1410
|
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1411
|
+
# @example Request syntax with placeholder values
|
1412
|
+
#
|
1413
|
+
# route_tables = vpc.route_tables({
|
1414
|
+
# dry_run: false,
|
1415
|
+
# route_table_ids: ["String"],
|
1416
|
+
# filters: [
|
1417
|
+
# {
|
1418
|
+
# name: "String",
|
1419
|
+
# values: ["String"],
|
1420
|
+
# },
|
1421
|
+
# ],
|
1422
|
+
# })
|
1423
|
+
# @param [Hash] options ({})
|
1424
|
+
# @option options [Boolean] :dry_run
|
1425
|
+
# Checks whether you have the required permissions for the action,
|
1426
|
+
# without actually making the request, and provides an error response.
|
1427
|
+
# If you have the required permissions, the error response is
|
1428
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
1429
|
+
# @option options [Array<String>] :route_table_ids
|
1430
|
+
# One or more route table IDs.
|
1431
|
+
#
|
1432
|
+
# Default: Describes all your route tables.
|
1433
|
+
# @option options [Array<Types::Filter>] :filters
|
1434
|
+
# One or more filters.
|
1435
|
+
#
|
1436
|
+
# * `association.route-table-association-id` - The ID of an association
|
1437
|
+
# ID for the route table.
|
1438
|
+
#
|
1439
|
+
# * `association.route-table-id` - The ID of the route table involved in
|
1440
|
+
# the association.
|
1441
|
+
#
|
1442
|
+
# * `association.subnet-id` - The ID of the subnet involved in the
|
1443
|
+
# association.
|
1444
|
+
#
|
1445
|
+
# * `association.main` - Indicates whether the route table is the main
|
1446
|
+
# route table for the VPC (`true` \| `false`).
|
1447
|
+
#
|
1448
|
+
# * `route-table-id` - The ID of the route table.
|
1449
|
+
#
|
1450
|
+
# * `route.destination-cidr-block` - The IPv4 CIDR range specified in a
|
1451
|
+
# route in the table.
|
1452
|
+
#
|
1453
|
+
# * `route.destination-ipv6-cidr-block` - The IPv6 CIDR range specified
|
1454
|
+
# in a route in the route table.
|
1455
|
+
#
|
1456
|
+
# * `route.destination-prefix-list-id` - The ID (prefix) of the AWS
|
1457
|
+
# service specified in a route in the table.
|
1458
|
+
#
|
1459
|
+
# * `route.egress-only-internet-gateway-id` - The ID of an egress-only
|
1460
|
+
# Internet gateway specified in a route in the route table.
|
1461
|
+
#
|
1462
|
+
# * `route.gateway-id` - The ID of a gateway specified in a route in the
|
1463
|
+
# table.
|
1464
|
+
#
|
1465
|
+
# * `route.instance-id` - The ID of an instance specified in a route in
|
1466
|
+
# the table.
|
1467
|
+
#
|
1468
|
+
# * `route.nat-gateway-id` - The ID of a NAT gateway.
|
1469
|
+
#
|
1470
|
+
# * `route.origin` - Describes how the route was created.
|
1471
|
+
# `CreateRouteTable` indicates that the route was automatically
|
1472
|
+
# created when the route table was created; `CreateRoute` indicates
|
1473
|
+
# that the route was manually added to the route table;
|
1474
|
+
# `EnableVgwRoutePropagation` indicates that the route was propagated
|
1475
|
+
# by route propagation.
|
1476
|
+
#
|
1477
|
+
# * `route.state` - The state of a route in the route table (`active` \|
|
1478
|
+
# `blackhole`). The blackhole state indicates that the route's target
|
1479
|
+
# isn't available (for example, the specified gateway isn't attached
|
1480
|
+
# to the VPC, the specified NAT instance has been terminated, and so
|
1481
|
+
# on).
|
1482
|
+
#
|
1483
|
+
# * `route.vpc-peering-connection-id` - The ID of a VPC peering
|
1484
|
+
# connection specified in a route in the table.
|
1485
|
+
#
|
1486
|
+
# * `tag`\:*key*=*value* - The key/value combination of a tag assigned
|
1487
|
+
# to the resource. Specify the key of the tag in the filter name and
|
1488
|
+
# the value of the tag in the filter value. For example, for the tag
|
1489
|
+
# Purpose=X, specify `tag:Purpose` for the filter name and `X` for the
|
1490
|
+
# filter value.
|
1491
|
+
#
|
1492
|
+
# * `tag-key` - The key of a tag assigned to the resource. This filter
|
1493
|
+
# is independent of the `tag-value` filter. For example, if you use
|
1494
|
+
# both the filter "tag-key=Purpose" and the filter "tag-value=X",
|
1495
|
+
# you get any resources assigned both the tag key Purpose (regardless
|
1496
|
+
# of what the tag's value is), and the tag value X (regardless of
|
1497
|
+
# what the tag's key is). If you want to list only resources where
|
1498
|
+
# Purpose is X, see the `tag`\:*key*=*value* filter.
|
1499
|
+
#
|
1500
|
+
# * `tag-value` - The value of a tag assigned to the resource. This
|
1501
|
+
# filter is independent of the `tag-key` filter.
|
1502
|
+
#
|
1503
|
+
# * `vpc-id` - The ID of the VPC for the route table.
|
1504
|
+
# @return [RouteTable::Collection]
|
1505
|
+
def route_tables(options = {})
|
1506
|
+
batches = Enumerator.new do |y|
|
1507
|
+
batch = []
|
1508
|
+
options = Aws::Util.deep_merge(options, filters: [{
|
1509
|
+
name: "vpc-id",
|
1510
|
+
values: [@id]
|
1511
|
+
}])
|
1512
|
+
resp = @client.describe_route_tables(options)
|
1513
|
+
resp.data.route_tables.each do |r|
|
1514
|
+
batch << RouteTable.new(
|
1515
|
+
id: r.route_table_id,
|
1516
|
+
data: r,
|
1517
|
+
client: @client
|
1518
|
+
)
|
1501
1519
|
end
|
1502
|
-
|
1520
|
+
y.yield(batch)
|
1503
1521
|
end
|
1522
|
+
RouteTable::Collection.new(batches)
|
1523
|
+
end
|
1504
1524
|
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
end
|
1598
|
-
y.yield(batch)
|
1525
|
+
# @example Request syntax with placeholder values
|
1526
|
+
#
|
1527
|
+
# security_groups = vpc.security_groups({
|
1528
|
+
# dry_run: false,
|
1529
|
+
# group_names: ["String"],
|
1530
|
+
# group_ids: ["String"],
|
1531
|
+
# filters: [
|
1532
|
+
# {
|
1533
|
+
# name: "String",
|
1534
|
+
# values: ["String"],
|
1535
|
+
# },
|
1536
|
+
# ],
|
1537
|
+
# })
|
1538
|
+
# @param [Hash] options ({})
|
1539
|
+
# @option options [Boolean] :dry_run
|
1540
|
+
# Checks whether you have the required permissions for the action,
|
1541
|
+
# without actually making the request, and provides an error response.
|
1542
|
+
# If you have the required permissions, the error response is
|
1543
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
1544
|
+
# @option options [Array<String>] :group_names
|
1545
|
+
# \[EC2-Classic and default VPC only\] One or more security group names.
|
1546
|
+
# You can specify either the security group name or the security group
|
1547
|
+
# ID. For security groups in a nondefault VPC, use the `group-name`
|
1548
|
+
# filter to describe security groups by name.
|
1549
|
+
#
|
1550
|
+
# Default: Describes all your security groups.
|
1551
|
+
# @option options [Array<String>] :group_ids
|
1552
|
+
# One or more security group IDs. Required for security groups in a
|
1553
|
+
# nondefault VPC.
|
1554
|
+
#
|
1555
|
+
# Default: Describes all your security groups.
|
1556
|
+
# @option options [Array<Types::Filter>] :filters
|
1557
|
+
# One or more filters. If using multiple filters for rules, the results
|
1558
|
+
# include security groups for which any combination of rules - not
|
1559
|
+
# necessarily a single rule - match all filters.
|
1560
|
+
#
|
1561
|
+
# * `description` - The description of the security group.
|
1562
|
+
#
|
1563
|
+
# * `egress.ip-permission.prefix-list-id` - The ID (prefix) of the AWS
|
1564
|
+
# service to which the security group allows access.
|
1565
|
+
#
|
1566
|
+
# * `group-id` - The ID of the security group.
|
1567
|
+
#
|
1568
|
+
# * `group-name` - The name of the security group.
|
1569
|
+
#
|
1570
|
+
# * `ip-permission.cidr` - An IPv4 CIDR range that has been granted
|
1571
|
+
# permission in a security group rule.
|
1572
|
+
#
|
1573
|
+
# * `ip-permission.from-port` - The start of port range for the TCP and
|
1574
|
+
# UDP protocols, or an ICMP type number.
|
1575
|
+
#
|
1576
|
+
# * `ip-permission.group-id` - The ID of a security group that has been
|
1577
|
+
# granted permission.
|
1578
|
+
#
|
1579
|
+
# * `ip-permission.group-name` - The name of a security group that has
|
1580
|
+
# been granted permission.
|
1581
|
+
#
|
1582
|
+
# * `ip-permission.ipv6-cidr` - An IPv6 CIDR range that has been granted
|
1583
|
+
# permission in a security group rule.
|
1584
|
+
#
|
1585
|
+
# * `ip-permission.protocol` - The IP protocol for the permission (`tcp`
|
1586
|
+
# \| `udp` \| `icmp` or a protocol number).
|
1587
|
+
#
|
1588
|
+
# * `ip-permission.to-port` - The end of port range for the TCP and UDP
|
1589
|
+
# protocols, or an ICMP code.
|
1590
|
+
#
|
1591
|
+
# * `ip-permission.user-id` - The ID of an AWS account that has been
|
1592
|
+
# granted permission.
|
1593
|
+
#
|
1594
|
+
# * `owner-id` - The AWS account ID of the owner of the security group.
|
1595
|
+
#
|
1596
|
+
# * `tag-key` - The key of a tag assigned to the security group.
|
1597
|
+
#
|
1598
|
+
# * `tag-value` - The value of a tag assigned to the security group.
|
1599
|
+
#
|
1600
|
+
# * `vpc-id` - The ID of the VPC specified when the security group was
|
1601
|
+
# created.
|
1602
|
+
# @return [SecurityGroup::Collection]
|
1603
|
+
def security_groups(options = {})
|
1604
|
+
batches = Enumerator.new do |y|
|
1605
|
+
batch = []
|
1606
|
+
options = Aws::Util.deep_merge(options, filters: [{
|
1607
|
+
name: "vpc-id",
|
1608
|
+
values: [@id]
|
1609
|
+
}])
|
1610
|
+
resp = @client.describe_security_groups(options)
|
1611
|
+
resp.data.security_groups.each do |s|
|
1612
|
+
batch << SecurityGroup.new(
|
1613
|
+
id: s.group_id,
|
1614
|
+
data: s,
|
1615
|
+
client: @client
|
1616
|
+
)
|
1599
1617
|
end
|
1600
|
-
|
1618
|
+
y.yield(batch)
|
1601
1619
|
end
|
1620
|
+
SecurityGroup::Collection.new(batches)
|
1621
|
+
end
|
1602
1622
|
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1623
|
+
# @example Request syntax with placeholder values
|
1624
|
+
#
|
1625
|
+
# subnets = vpc.subnets({
|
1626
|
+
# dry_run: false,
|
1627
|
+
# subnet_ids: ["String"],
|
1628
|
+
# filters: [
|
1629
|
+
# {
|
1630
|
+
# name: "String",
|
1631
|
+
# values: ["String"],
|
1632
|
+
# },
|
1633
|
+
# ],
|
1634
|
+
# })
|
1635
|
+
# @param [Hash] options ({})
|
1636
|
+
# @option options [Boolean] :dry_run
|
1637
|
+
# Checks whether you have the required permissions for the action,
|
1638
|
+
# without actually making the request, and provides an error response.
|
1639
|
+
# If you have the required permissions, the error response is
|
1640
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
1641
|
+
# @option options [Array<String>] :subnet_ids
|
1642
|
+
# One or more subnet IDs.
|
1643
|
+
#
|
1644
|
+
# Default: Describes all your subnets.
|
1645
|
+
# @option options [Array<Types::Filter>] :filters
|
1646
|
+
# One or more filters.
|
1647
|
+
#
|
1648
|
+
# * `availabilityZone` - The Availability Zone for the subnet. You can
|
1649
|
+
# also use `availability-zone` as the filter name.
|
1650
|
+
#
|
1651
|
+
# * `available-ip-address-count` - The number of IPv4 addresses in the
|
1652
|
+
# subnet that are available.
|
1653
|
+
#
|
1654
|
+
# * `cidrBlock` - The IPv4 CIDR block of the subnet. The CIDR block you
|
1655
|
+
# specify must exactly match the subnet's CIDR block for information
|
1656
|
+
# to be returned for the subnet. You can also use `cidr` or
|
1657
|
+
# `cidr-block` as the filter names.
|
1658
|
+
#
|
1659
|
+
# * `defaultForAz` - Indicates whether this is the default subnet for
|
1660
|
+
# the Availability Zone. You can also use `default-for-az` as the
|
1661
|
+
# filter name.
|
1662
|
+
#
|
1663
|
+
# * `ipv6-cidr-block-association.ipv6-cidr-block` - An IPv6 CIDR block
|
1664
|
+
# associated with the subnet.
|
1665
|
+
#
|
1666
|
+
# * `ipv6-cidr-block-association.association-id` - An association ID for
|
1667
|
+
# an IPv6 CIDR block associated with the subnet.
|
1668
|
+
#
|
1669
|
+
# * `ipv6-cidr-block-association.state` - The state of an IPv6 CIDR
|
1670
|
+
# block associated with the subnet.
|
1671
|
+
#
|
1672
|
+
# * `state` - The state of the subnet (`pending` \| `available`).
|
1673
|
+
#
|
1674
|
+
# * `subnet-id` - The ID of the subnet.
|
1675
|
+
#
|
1676
|
+
# * `tag`\:*key*=*value* - The key/value combination of a tag assigned
|
1677
|
+
# to the resource. Specify the key of the tag in the filter name and
|
1678
|
+
# the value of the tag in the filter value. For example, for the tag
|
1679
|
+
# Purpose=X, specify `tag:Purpose` for the filter name and `X` for the
|
1680
|
+
# filter value.
|
1681
|
+
#
|
1682
|
+
# * `tag-key` - The key of a tag assigned to the resource. This filter
|
1683
|
+
# is independent of the `tag-value` filter. For example, if you use
|
1684
|
+
# both the filter "tag-key=Purpose" and the filter "tag-value=X",
|
1685
|
+
# you get any resources assigned both the tag key Purpose (regardless
|
1686
|
+
# of what the tag's value is), and the tag value X (regardless of
|
1687
|
+
# what the tag's key is). If you want to list only resources where
|
1688
|
+
# Purpose is X, see the `tag`\:*key*=*value* filter.
|
1689
|
+
#
|
1690
|
+
# * `tag-value` - The value of a tag assigned to the resource. This
|
1691
|
+
# filter is independent of the `tag-key` filter.
|
1692
|
+
#
|
1693
|
+
# * `vpc-id` - The ID of the VPC for the subnet.
|
1694
|
+
# @return [Subnet::Collection]
|
1695
|
+
def subnets(options = {})
|
1696
|
+
batches = Enumerator.new do |y|
|
1697
|
+
batch = []
|
1698
|
+
options = Aws::Util.deep_merge(options, filters: [{
|
1699
|
+
name: "vpc-id",
|
1700
|
+
values: [@id]
|
1701
|
+
}])
|
1702
|
+
resp = @client.describe_subnets(options)
|
1703
|
+
resp.data.subnets.each do |s|
|
1704
|
+
batch << Subnet.new(
|
1705
|
+
id: s.subnet_id,
|
1706
|
+
data: s,
|
1707
|
+
client: @client
|
1708
|
+
)
|
1688
1709
|
end
|
1689
|
-
|
1710
|
+
y.yield(batch)
|
1690
1711
|
end
|
1712
|
+
Subnet::Collection.new(batches)
|
1713
|
+
end
|
1691
1714
|
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1715
|
+
# @deprecated
|
1716
|
+
# @api private
|
1717
|
+
def identifiers
|
1718
|
+
{ id: @id }
|
1719
|
+
end
|
1720
|
+
deprecated(:identifiers)
|
1698
1721
|
|
1699
|
-
|
1722
|
+
private
|
1700
1723
|
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1708
|
-
|
1709
|
-
end
|
1724
|
+
def extract_id(args, options)
|
1725
|
+
value = args[0] || options.delete(:id)
|
1726
|
+
case value
|
1727
|
+
when String then value
|
1728
|
+
when nil then raise ArgumentError, "missing required option :id"
|
1729
|
+
else
|
1730
|
+
msg = "expected :id to be a String, got #{value.class}"
|
1731
|
+
raise ArgumentError, msg
|
1710
1732
|
end
|
1733
|
+
end
|
1711
1734
|
|
1712
|
-
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
end
|
1719
|
-
yield(waiter.waiter)
|
1735
|
+
def yield_waiter_and_warn(waiter, &block)
|
1736
|
+
if !@waiter_block_warned
|
1737
|
+
msg = "pass options to configure the waiter; "
|
1738
|
+
msg << "yielding the waiter is deprecated"
|
1739
|
+
warn(msg)
|
1740
|
+
@waiter_block_warned = true
|
1720
1741
|
end
|
1742
|
+
yield(waiter.waiter)
|
1743
|
+
end
|
1721
1744
|
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
end
|
1745
|
+
def separate_params_and_options(options)
|
1746
|
+
opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
|
1747
|
+
waiter_opts = {}
|
1748
|
+
waiter_params = {}
|
1749
|
+
options.each_pair do |key, value|
|
1750
|
+
if opts.include?(key)
|
1751
|
+
waiter_opts[key] = value
|
1752
|
+
else
|
1753
|
+
waiter_params[key] = value
|
1732
1754
|
end
|
1733
|
-
waiter_opts[:client] ||= @client
|
1734
|
-
[waiter_opts, waiter_params]
|
1735
1755
|
end
|
1736
|
-
|
1737
|
-
|
1756
|
+
waiter_opts[:client] ||= @client
|
1757
|
+
[waiter_opts, waiter_params]
|
1738
1758
|
end
|
1759
|
+
|
1760
|
+
class Collection < Aws::Resources::Collection; end
|
1739
1761
|
end
|
1740
1762
|
end
|