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.
@@ -1,1740 +1,1762 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
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
- module EC2
10
- class Vpc
8
+ module Aws::EC2
9
+ class Vpc
11
10
 
12
- extend Aws::Deprecations
11
+ extend Aws::Deprecations
13
12
 
14
- # @overload def initialize(id, options = {})
15
- # @param [String] id
16
- # @option options [Client] :client
17
- # @overload def initialize(options = {})
18
- # @option options [required, String] :id
19
- # @option options [Client] :client
20
- def initialize(*args)
21
- options = Hash === args.last ? args.pop.dup : {}
22
- @id = extract_id(args, options)
23
- @data = options.delete(:data)
24
- @client = options.delete(:client) || Client.new(options)
25
- end
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
- # @!group Read-Only Attributes
26
+ # @!group Read-Only Attributes
28
27
 
29
- # @return [String]
30
- def id
31
- @id
32
- end
33
- alias :vpc_id :id
28
+ # @return [String]
29
+ def id
30
+ @id
31
+ end
32
+ alias :vpc_id :id
34
33
 
35
- # The current state of the VPC.
36
- # @return [String]
37
- def state
38
- data.state
39
- end
34
+ # The current state of the VPC.
35
+ # @return [String]
36
+ def state
37
+ data.state
38
+ end
40
39
 
41
- # The IPv4 CIDR block for the VPC.
42
- # @return [String]
43
- def cidr_block
44
- data.cidr_block
45
- end
40
+ # The IPv4 CIDR block for the VPC.
41
+ # @return [String]
42
+ def cidr_block
43
+ data.cidr_block
44
+ end
46
45
 
47
- # The ID of the set of DHCP options you've associated with the VPC (or
48
- # `default` if the default options are associated with the VPC).
49
- # @return [String]
50
- def dhcp_options_id
51
- data.dhcp_options_id
52
- end
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
- # Any tags assigned to the VPC.
55
- # @return [Array<Types::Tag>]
56
- def tags
57
- data.tags
58
- end
53
+ # Any tags assigned to the VPC.
54
+ # @return [Array<Types::Tag>]
55
+ def tags
56
+ data.tags
57
+ end
59
58
 
60
- # The allowed tenancy of instances launched into the VPC.
61
- # @return [String]
62
- def instance_tenancy
63
- data.instance_tenancy
64
- end
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
- # Indicates whether the VPC is the default VPC.
67
- # @return [Boolean]
68
- def is_default
69
- data.is_default
70
- end
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
- # Information about the IPv6 CIDR blocks associated with the VPC.
73
- # @return [Array<Types::VpcIpv6CidrBlockAssociation>]
74
- def ipv_6_cidr_block_association_set
75
- data.ipv_6_cidr_block_association_set
76
- end
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
- # @!endgroup
77
+ # @!endgroup
79
78
 
80
- # @return [Client]
81
- def client
82
- @client
83
- end
79
+ # @return [Client]
80
+ def client
81
+ @client
82
+ end
84
83
 
85
- # Loads, or reloads {#data} for the current {Vpc}.
86
- # Returns `self` making it possible to chain methods.
87
- #
88
- # vpc.reload.data
89
- #
90
- # @return [self]
91
- def load
92
- resp = @client.describe_vpcs(vpc_ids: [@id])
93
- @data = resp.vpcs[0]
94
- self
95
- end
96
- alias :reload :load
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
- # @return [Types::Vpc]
99
- # Returns the data for this {Vpc}. Calls
100
- # {Client#describe_vpcs} if {#data_loaded?} is `false`.
101
- def data
102
- load unless @data
103
- @data
104
- end
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
- # @return [Boolean]
107
- # Returns `true` if this resource is loaded. Accessing attributes or
108
- # {#data} on an unloaded resource will trigger a call to {#load}.
109
- def data_loaded?
110
- !!@data
111
- end
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
- # @param [Hash] options ({})
114
- # @return [Boolean]
115
- # Returns `true` if the Vpc exists.
116
- def exists?(options = {})
117
- begin
118
- wait_until_exists(options.merge(max_attempts: 1))
119
- true
120
- rescue Aws::Waiters::Errors::UnexpectedError => e
121
- raise e.error
122
- rescue Aws::Waiters::Errors::WaiterFailed
123
- false
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
- # @param [Hash] options ({})
128
- # @option options [Integer] :max_attempts (40)
129
- # @option options [Float] :delay (15)
130
- # @option options [Proc] :before_attempt
131
- # @option options [Proc] :before_wait
132
- # @return [Vpc]
133
- def wait_until_available(options = {})
134
- options, params = separate_params_and_options(options)
135
- waiter = Waiters::VpcAvailable.new(options)
136
- yield_waiter_and_warn(waiter, &Proc.new) if block_given?
137
- waiter.wait(params.merge(vpc_ids: [@id]))
138
- Vpc.new({
139
- id: @id,
140
- client: @client
141
- })
142
- end
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
- # @param [Hash] options ({})
145
- # @option options [Integer] :max_attempts (5)
146
- # @option options [Float] :delay (1)
147
- # @option options [Proc] :before_attempt
148
- # @option options [Proc] :before_wait
149
- # @return [Vpc]
150
- def wait_until_exists(options = {})
151
- options, params = separate_params_and_options(options)
152
- waiter = Waiters::VpcExists.new(options)
153
- yield_waiter_and_warn(waiter, &Proc.new) if block_given?
154
- waiter.wait(params.merge(vpc_ids: [@id]))
155
- Vpc.new({
156
- id: @id,
157
- client: @client
158
- })
159
- end
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
- # @!group Actions
160
+ # @!group Actions
162
161
 
163
- # @example Request syntax with placeholder values
164
- #
165
- # vpc.associate_dhcp_options({
166
- # dry_run: false,
167
- # dhcp_options_id: "String", # required
168
- # })
169
- # @param [Hash] options ({})
170
- # @option options [Boolean] :dry_run
171
- # Checks whether you have the required permissions for the action,
172
- # without actually making the request, and provides an error response.
173
- # If you have the required permissions, the error response is
174
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
175
- # @option options [required, String] :dhcp_options_id
176
- # The ID of the DHCP options set, or `default` to associate no DHCP
177
- # options with the VPC.
178
- # @return [EmptyStructure]
179
- def associate_dhcp_options(options = {})
180
- options = options.merge(vpc_id: @id)
181
- resp = @client.associate_dhcp_options(options)
182
- resp.data
183
- end
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
- # @example Request syntax with placeholder values
186
- #
187
- # vpc.attach_classic_link_instance({
188
- # dry_run: false,
189
- # instance_id: "String", # required
190
- # groups: ["String"], # required
191
- # })
192
- # @param [Hash] options ({})
193
- # @option options [Boolean] :dry_run
194
- # Checks whether you have the required permissions for the action,
195
- # without actually making the request, and provides an error response.
196
- # If you have the required permissions, the error response is
197
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
198
- # @option options [required, String] :instance_id
199
- # The ID of an EC2-Classic instance to link to the ClassicLink-enabled
200
- # VPC.
201
- # @option options [required, Array<String>] :groups
202
- # The ID of one or more of the VPC's security groups. You cannot
203
- # specify security groups from a different VPC.
204
- # @return [Types::AttachClassicLinkVpcResult]
205
- def attach_classic_link_instance(options = {})
206
- options = options.merge(vpc_id: @id)
207
- resp = @client.attach_classic_link_vpc(options)
208
- resp.data
209
- end
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
- # @example Request syntax with placeholder values
212
- #
213
- # vpc.attach_internet_gateway({
214
- # dry_run: false,
215
- # internet_gateway_id: "String", # required
216
- # })
217
- # @param [Hash] options ({})
218
- # @option options [Boolean] :dry_run
219
- # Checks whether you have the required permissions for the action,
220
- # without actually making the request, and provides an error response.
221
- # If you have the required permissions, the error response is
222
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
223
- # @option options [required, String] :internet_gateway_id
224
- # The ID of the Internet gateway.
225
- # @return [EmptyStructure]
226
- def attach_internet_gateway(options = {})
227
- options = options.merge(vpc_id: @id)
228
- resp = @client.attach_internet_gateway(options)
229
- resp.data
230
- end
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
- # @example Request syntax with placeholder values
233
- #
234
- # networkacl = vpc.create_network_acl({
235
- # dry_run: false,
236
- # })
237
- # @param [Hash] options ({})
238
- # @option options [Boolean] :dry_run
239
- # Checks whether you have the required permissions for the action,
240
- # without actually making the request, and provides an error response.
241
- # If you have the required permissions, the error response is
242
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
243
- # @return [NetworkAcl]
244
- def create_network_acl(options = {})
245
- options = options.merge(vpc_id: @id)
246
- resp = @client.create_network_acl(options)
247
- NetworkAcl.new(
248
- id: resp.data.network_acl.network_acl_id,
249
- data: resp.data.network_acl,
250
- client: @client
251
- )
252
- end
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
- # @example Request syntax with placeholder values
255
- #
256
- # routetable = vpc.create_route_table({
257
- # dry_run: false,
258
- # })
259
- # @param [Hash] options ({})
260
- # @option options [Boolean] :dry_run
261
- # Checks whether you have the required permissions for the action,
262
- # without actually making the request, and provides an error response.
263
- # If you have the required permissions, the error response is
264
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
265
- # @return [RouteTable]
266
- def create_route_table(options = {})
267
- options = options.merge(vpc_id: @id)
268
- resp = @client.create_route_table(options)
269
- RouteTable.new(
270
- id: resp.data.route_table.route_table_id,
271
- data: resp.data.route_table,
272
- client: @client
273
- )
274
- end
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
- # @example Request syntax with placeholder values
277
- #
278
- # securitygroup = vpc.create_security_group({
279
- # dry_run: false,
280
- # group_name: "String", # required
281
- # description: "String", # required
282
- # })
283
- # @param [Hash] options ({})
284
- # @option options [Boolean] :dry_run
285
- # Checks whether you have the required permissions for the action,
286
- # without actually making the request, and provides an error response.
287
- # If you have the required permissions, the error response is
288
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
289
- # @option options [required, String] :group_name
290
- # The name of the security group.
291
- #
292
- # Constraints: Up to 255 characters in length
293
- #
294
- # Constraints for EC2-Classic: ASCII characters
295
- #
296
- # Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and
297
- # .\_-:/()#,@\[\]+=&amp;;\\\{\\}!$*
298
- # @option options [required, String] :description
299
- # A description for the security group. This is informational only.
300
- #
301
- # Constraints: Up to 255 characters in length
302
- #
303
- # Constraints for EC2-Classic: ASCII characters
304
- #
305
- # Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and
306
- # .\_-:/()#,@\[\]+=&amp;;\\\{\\}!$*
307
- # @return [SecurityGroup]
308
- def create_security_group(options = {})
309
- options = options.merge(vpc_id: @id)
310
- resp = @client.create_security_group(options)
311
- SecurityGroup.new(
312
- id: resp.data.group_id,
313
- client: @client
314
- )
315
- end
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
+ # .\_-:/()#,@\[\]+=&amp;;\\\{\\}!$*
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
+ # .\_-:/()#,@\[\]+=&amp;;\\\{\\}!$*
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
- # @example Request syntax with placeholder values
318
- #
319
- # subnet = vpc.create_subnet({
320
- # dry_run: false,
321
- # cidr_block: "String", # required
322
- # ipv_6_cidr_block: "String",
323
- # availability_zone: "String",
324
- # })
325
- # @param [Hash] options ({})
326
- # @option options [Boolean] :dry_run
327
- # Checks whether you have the required permissions for the action,
328
- # without actually making the request, and provides an error response.
329
- # If you have the required permissions, the error response is
330
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
331
- # @option options [required, String] :cidr_block
332
- # The IPv4 network range for the subnet, in CIDR notation. For example,
333
- # `10.0.0.0/24`.
334
- # @option options [String] :ipv_6_cidr_block
335
- # The IPv6 network range for the subnet, in CIDR notation. The subnet
336
- # size must use a /64 prefix length.
337
- # @option options [String] :availability_zone
338
- # The Availability Zone for the subnet.
339
- #
340
- # Default: AWS selects one for you. If you create more than one subnet
341
- # in your VPC, we may not necessarily select a different zone for each
342
- # subnet.
343
- # @return [Subnet]
344
- def create_subnet(options = {})
345
- options = options.merge(vpc_id: @id)
346
- resp = @client.create_subnet(options)
347
- Subnet.new(
348
- id: resp.data.subnet.subnet_id,
349
- data: resp.data.subnet,
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
- # @example Request syntax with placeholder values
355
- #
356
- # tag = vpc.create_tags({
357
- # dry_run: false,
358
- # tags: [ # required
359
- # {
360
- # key: "String",
361
- # value: "String",
362
- # },
363
- # ],
364
- # })
365
- # @param [Hash] options ({})
366
- # @option options [Boolean] :dry_run
367
- # Checks whether you have the required permissions for the action,
368
- # without actually making the request, and provides an error response.
369
- # If you have the required permissions, the error response is
370
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
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
- # @example Request syntax with placeholder values
392
- #
393
- # vpc.delete({
394
- # dry_run: false,
395
- # })
396
- # @param [Hash] options ({})
397
- # @option options [Boolean] :dry_run
398
- # Checks whether you have the required permissions for the action,
399
- # without actually making the request, and provides an error response.
400
- # If you have the required permissions, the error response is
401
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
402
- # @return [EmptyStructure]
403
- def delete(options = {})
404
- options = options.merge(vpc_id: @id)
405
- resp = @client.delete_vpc(options)
406
- resp.data
407
- end
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
- # @example Request syntax with placeholder values
410
- #
411
- # vpc.describe_attribute({
412
- # dry_run: false,
413
- # attribute: "enableDnsSupport", # required, accepts enableDnsSupport, enableDnsHostnames
414
- # })
415
- # @param [Hash] options ({})
416
- # @option options [Boolean] :dry_run
417
- # Checks whether you have the required permissions for the action,
418
- # without actually making the request, and provides an error response.
419
- # If you have the required permissions, the error response is
420
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
421
- # @option options [required, String] :attribute
422
- # The VPC attribute.
423
- # @return [Types::DescribeVpcAttributeResult]
424
- def describe_attribute(options = {})
425
- options = options.merge(vpc_id: @id)
426
- resp = @client.describe_vpc_attribute(options)
427
- resp.data
428
- end
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
- # @example Request syntax with placeholder values
431
- #
432
- # vpc.detach_classic_link_instance({
433
- # dry_run: false,
434
- # instance_id: "String", # required
435
- # })
436
- # @param [Hash] options ({})
437
- # @option options [Boolean] :dry_run
438
- # Checks whether you have the required permissions for the action,
439
- # without actually making the request, and provides an error response.
440
- # If you have the required permissions, the error response is
441
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
442
- # @option options [required, String] :instance_id
443
- # The ID of the instance to unlink from the VPC.
444
- # @return [Types::DetachClassicLinkVpcResult]
445
- def detach_classic_link_instance(options = {})
446
- options = options.merge(vpc_id: @id)
447
- resp = @client.detach_classic_link_vpc(options)
448
- resp.data
449
- end
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
- # @example Request syntax with placeholder values
452
- #
453
- # vpc.detach_internet_gateway({
454
- # dry_run: false,
455
- # internet_gateway_id: "String", # required
456
- # })
457
- # @param [Hash] options ({})
458
- # @option options [Boolean] :dry_run
459
- # Checks whether you have the required permissions for the action,
460
- # without actually making the request, and provides an error response.
461
- # If you have the required permissions, the error response is
462
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
463
- # @option options [required, String] :internet_gateway_id
464
- # The ID of the Internet gateway.
465
- # @return [EmptyStructure]
466
- def detach_internet_gateway(options = {})
467
- options = options.merge(vpc_id: @id)
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
- # @example Request syntax with placeholder values
473
- #
474
- # vpc.disable_classic_link({
475
- # dry_run: false,
476
- # })
477
- # @param [Hash] options ({})
478
- # @option options [Boolean] :dry_run
479
- # Checks whether you have the required permissions for the action,
480
- # without actually making the request, and provides an error response.
481
- # If you have the required permissions, the error response is
482
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
483
- # @return [Types::DisableVpcClassicLinkResult]
484
- def disable_classic_link(options = {})
485
- options = options.merge(vpc_id: @id)
486
- resp = @client.disable_vpc_classic_link(options)
487
- resp.data
488
- end
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
- # @example Request syntax with placeholder values
491
- #
492
- # vpc.enable_classic_link({
493
- # dry_run: false,
494
- # })
495
- # @param [Hash] options ({})
496
- # @option options [Boolean] :dry_run
497
- # Checks whether you have the required permissions for the action,
498
- # without actually making the request, and provides an error response.
499
- # If you have the required permissions, the error response is
500
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
501
- # @return [Types::EnableVpcClassicLinkResult]
502
- def enable_classic_link(options = {})
503
- options = options.merge(vpc_id: @id)
504
- resp = @client.enable_vpc_classic_link(options)
505
- resp.data
506
- end
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
- # @example Request syntax with placeholder values
509
- #
510
- # vpc.modify_attribute({
511
- # enable_dns_support: {
512
- # value: false,
513
- # },
514
- # enable_dns_hostnames: {
515
- # value: false,
516
- # },
517
- # })
518
- # @param [Hash] options ({})
519
- # @option options [Types::AttributeBooleanValue] :enable_dns_support
520
- # Indicates whether the DNS resolution is supported for the VPC. If
521
- # enabled, queries to the Amazon provided DNS server at the
522
- # 169.254.169.253 IP address, or the reserved IP address at the base of
523
- # the VPC network range "plus two" will succeed. If disabled, the
524
- # Amazon provided DNS service in the VPC that resolves public DNS
525
- # hostnames to IP addresses is not enabled.
526
- #
527
- # You cannot modify the DNS resolution and DNS hostnames attributes in
528
- # the same request. Use separate requests for each attribute.
529
- # @option options [Types::AttributeBooleanValue] :enable_dns_hostnames
530
- # Indicates whether the instances launched in the VPC get DNS hostnames.
531
- # If enabled, instances in the VPC get DNS hostnames; otherwise, they do
532
- # not.
533
- #
534
- # You cannot modify the DNS resolution and DNS hostnames attributes in
535
- # the same request. Use separate requests for each attribute. You can
536
- # only enable DNS hostnames if you've enabled DNS support.
537
- # @return [EmptyStructure]
538
- def modify_attribute(options = {})
539
- options = options.merge(vpc_id: @id)
540
- resp = @client.modify_vpc_attribute(options)
541
- resp.data
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
- # @example Request syntax with placeholder values
545
- #
546
- # vpcpeeringconnection = vpc.request_vpc_peering_connection({
547
- # dry_run: false,
548
- # peer_vpc_id: "String",
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
- # @!group Associations
576
-
577
- # @example Request syntax with placeholder values
578
- #
579
- # acceptedvpcpeeringconnections = vpc.accepted_vpc_peering_connections({
580
- # dry_run: false,
581
- # vpc_peering_connection_ids: ["String"],
582
- # filters: [
583
- # {
584
- # name: "String",
585
- # values: ["String"],
586
- # },
587
- # ],
588
- # })
589
- # @param [Hash] options ({})
590
- # @option options [Boolean] :dry_run
591
- # Checks whether you have the required permissions for the action,
592
- # without actually making the request, and provides an error response.
593
- # If you have the required permissions, the error response is
594
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
595
- # @option options [Array<String>] :vpc_peering_connection_ids
596
- # One or more VPC peering connection IDs.
597
- #
598
- # Default: Describes all your VPC peering connections.
599
- # @option options [Array<Types::Filter>] :filters
600
- # One or more filters.
601
- #
602
- # * `accepter-vpc-info.cidr-block` - The IPv4 CIDR block of the peer
603
- # VPC.
604
- #
605
- # * `accepter-vpc-info.owner-id` - The AWS account ID of the owner of
606
- # the peer VPC.
607
- #
608
- # * `accepter-vpc-info.vpc-id` - The ID of the peer VPC.
609
- #
610
- # * `expiration-time` - The expiration date and time for the VPC peering
611
- # connection.
612
- #
613
- # * `requester-vpc-info.cidr-block` - The IPv4 CIDR block of the
614
- # requester's VPC.
615
- #
616
- # * `requester-vpc-info.owner-id` - The AWS account ID of the owner of
617
- # the requester VPC.
618
- #
619
- # * `requester-vpc-info.vpc-id` - The ID of the requester VPC.
620
- #
621
- # * `status-code` - The status of the VPC peering connection
622
- # (`pending-acceptance` \| `failed` \| `expired` \| `provisioning` \|
623
- # `active` \| `deleted` \| `rejected`).
624
- #
625
- # * `status-message` - A message that provides more information about
626
- # the status of the VPC peering connection, if applicable.
627
- #
628
- # * `tag`\:*key*=*value* - The key/value combination of a tag assigned
629
- # to the resource.
630
- #
631
- # * `tag-key` - The key of a tag assigned to the resource. This filter
632
- # is independent of the `tag-value` filter. For example, if you use
633
- # both the filter "tag-key=Purpose" and the filter "tag-value=X",
634
- # you get any resources assigned both the tag key Purpose (regardless
635
- # of what the tag's value is), and the tag value X (regardless of
636
- # what the tag's key is). If you want to list only resources where
637
- # Purpose is X, see the `tag`\:*key*=*value* filter.
638
- #
639
- # * `tag-value` - The value of a tag assigned to the resource. This
640
- # filter is independent of the `tag-key` filter.
641
- #
642
- # * `vpc-peering-connection-id` - The ID of the VPC peering connection.
643
- # @return [VpcPeeringConnection::Collection]
644
- def accepted_vpc_peering_connections(options = {})
645
- batches = Enumerator.new do |y|
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
- options = Aws::Util.deep_merge(options, filters: [{
648
- name: "accepter-vpc-info.vpc-id",
649
- values: [@id]
650
- }])
651
- resp = @client.describe_vpc_peering_connections(options)
652
- resp.data.vpc_peering_connections.each do |v|
653
- batch << VpcPeeringConnection.new(
654
- id: v.vpc_peering_connection_id,
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
- # @return [DhcpOptions, nil]
665
- def dhcp_options
666
- if data.dhcp_options_id
667
- DhcpOptions.new(
668
- id: data.dhcp_options_id,
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
- InternetGateway::Collection.new(batches)
1050
+ y.yield(batch)
1045
1051
  end
1052
+ InternetGateway::Collection.new(batches)
1053
+ end
1046
1054
 
1047
- # @example Request syntax with placeholder values
1048
- #
1049
- # networkacls = vpc.network_acls({
1050
- # dry_run: false,
1051
- # network_acl_ids: ["String"],
1052
- # filters: [
1053
- # {
1054
- # name: "String",
1055
- # values: ["String"],
1056
- # },
1057
- # ],
1058
- # })
1059
- # @param [Hash] options ({})
1060
- # @option options [Boolean] :dry_run
1061
- # Checks whether you have the required permissions for the action,
1062
- # without actually making the request, and provides an error response.
1063
- # If you have the required permissions, the error response is
1064
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
1065
- # @option options [Array<String>] :network_acl_ids
1066
- # One or more network ACL IDs.
1067
- #
1068
- # Default: Describes all your network ACLs.
1069
- # @option options [Array<Types::Filter>] :filters
1070
- # One or more filters.
1071
- #
1072
- # * `association.association-id` - The ID of an association ID for the
1073
- # ACL.
1074
- #
1075
- # * `association.network-acl-id` - The ID of the network ACL involved in
1076
- # the association.
1077
- #
1078
- # * `association.subnet-id` - The ID of the subnet involved in the
1079
- # association.
1080
- #
1081
- # * `default` - Indicates whether the ACL is the default network ACL for
1082
- # the VPC.
1083
- #
1084
- # * `entry.cidr` - The IPv4 CIDR range specified in the entry.
1085
- #
1086
- # * `entry.egress` - Indicates whether the entry applies to egress
1087
- # traffic.
1088
- #
1089
- # * `entry.icmp.code` - The ICMP code specified in the entry, if any.
1090
- #
1091
- # * `entry.icmp.type` - The ICMP type specified in the entry, if any.
1092
- #
1093
- # * `entry.ipv6-cidr` - The IPv6 CIDR range specified in the entry.
1094
- #
1095
- # * `entry.port-range.from` - The start of the port range specified in
1096
- # the entry.
1097
- #
1098
- # * `entry.port-range.to` - The end of the port range specified in the
1099
- # entry.
1100
- #
1101
- # * `entry.protocol` - The protocol specified in the entry (`tcp` \|
1102
- # `udp` \| `icmp` or a protocol number).
1103
- #
1104
- # * `entry.rule-action` - Allows or denies the matching traffic (`allow`
1105
- # \| `deny`).
1106
- #
1107
- # * `entry.rule-number` - The number of an entry (in other words, rule)
1108
- # in the ACL's set of entries.
1109
- #
1110
- # * `network-acl-id` - The ID of the network ACL.
1111
- #
1112
- # * `tag`\:*key*=*value* - The key/value combination of a tag assigned
1113
- # to the resource.
1114
- #
1115
- # * `tag-key` - The key of a tag assigned to the resource. This filter
1116
- # is independent of the `tag-value` filter. For example, if you use
1117
- # both the filter "tag-key=Purpose" and the filter "tag-value=X",
1118
- # you get any resources assigned both the tag key Purpose (regardless
1119
- # of what the tag's value is), and the tag value X (regardless of
1120
- # what the tag's key is). If you want to list only resources where
1121
- # Purpose is X, see the `tag`\:*key*=*value* filter.
1122
- #
1123
- # * `tag-value` - The value of a tag assigned to the resource. This
1124
- # filter is independent of the `tag-key` filter.
1125
- #
1126
- # * `vpc-id` - The ID of the VPC for the network ACL.
1127
- # @return [NetworkAcl::Collection]
1128
- def network_acls(options = {})
1129
- batches = Enumerator.new do |y|
1130
- batch = []
1131
- options = Aws::Util.deep_merge(options, filters: [{
1132
- name: "vpc-id",
1133
- values: [@id]
1134
- }])
1135
- resp = @client.describe_network_acls(options)
1136
- resp.data.network_acls.each do |n|
1137
- batch << NetworkAcl.new(
1138
- id: n.network_acl_id,
1139
- data: n,
1140
- client: @client
1141
- )
1142
- end
1143
- y.yield(batch)
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
- NetworkAcl::Collection.new(batches)
1154
+ y.yield(batch)
1146
1155
  end
1156
+ NetworkAcl::Collection.new(batches)
1157
+ end
1147
1158
 
1148
- # @example Request syntax with placeholder values
1149
- #
1150
- # networkinterfaces = vpc.network_interfaces({
1151
- # dry_run: false,
1152
- # network_interface_ids: ["String"],
1153
- # filters: [
1154
- # {
1155
- # name: "String",
1156
- # values: ["String"],
1157
- # },
1158
- # ],
1159
- # })
1160
- # @param [Hash] options ({})
1161
- # @option options [Boolean] :dry_run
1162
- # Checks whether you have the required permissions for the action,
1163
- # without actually making the request, and provides an error response.
1164
- # If you have the required permissions, the error response is
1165
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
1166
- # @option options [Array<String>] :network_interface_ids
1167
- # One or more network interface IDs.
1168
- #
1169
- # Default: Describes all your network interfaces.
1170
- # @option options [Array<Types::Filter>] :filters
1171
- # One or more filters.
1172
- #
1173
- # * `addresses.private-ip-address` - The private IPv4 addresses
1174
- # associated with the network interface.
1175
- #
1176
- # * `addresses.primary` - Whether the private IPv4 address is the
1177
- # primary IP address associated with the network interface.
1178
- #
1179
- # * `addresses.association.public-ip` - The association ID returned when
1180
- # the network interface was associated with the Elastic IP address
1181
- # (IPv4).
1182
- #
1183
- # * `addresses.association.owner-id` - The owner ID of the addresses
1184
- # associated with the network interface.
1185
- #
1186
- # * `association.association-id` - The association ID returned when the
1187
- # network interface was associated with an IPv4 address.
1188
- #
1189
- # * `association.allocation-id` - The allocation ID returned when you
1190
- # allocated the Elastic IP address (IPv4) for your network interface.
1191
- #
1192
- # * `association.ip-owner-id` - The owner of the Elastic IP address
1193
- # (IPv4) associated with the network interface.
1194
- #
1195
- # * `association.public-ip` - The address of the Elastic IP address
1196
- # (IPv4) bound to the network interface.
1197
- #
1198
- # * `association.public-dns-name` - The public DNS name for the network
1199
- # interface (IPv4).
1200
- #
1201
- # * `attachment.attachment-id` - The ID of the interface attachment.
1202
- #
1203
- # * `attachment.attach.time` - The time that the network interface was
1204
- # attached to an instance.
1205
- #
1206
- # * `attachment.delete-on-termination` - Indicates whether the
1207
- # attachment is deleted when an instance is terminated.
1208
- #
1209
- # * `attachment.device-index` - The device index to which the network
1210
- # interface is attached.
1211
- #
1212
- # * `attachment.instance-id` - The ID of the instance to which the
1213
- # network interface is attached.
1214
- #
1215
- # * `attachment.instance-owner-id` - The owner ID of the instance to
1216
- # which the network interface is attached.
1217
- #
1218
- # * `attachment.nat-gateway-id` - The ID of the NAT gateway to which the
1219
- # network interface is attached.
1220
- #
1221
- # * `attachment.status` - The status of the attachment (`attaching` \|
1222
- # `attached` \| `detaching` \| `detached`).
1223
- #
1224
- # * `availability-zone` - The Availability Zone of the network
1225
- # interface.
1226
- #
1227
- # * `description` - The description of the network interface.
1228
- #
1229
- # * `group-id` - The ID of a security group associated with the network
1230
- # interface.
1231
- #
1232
- # * `group-name` - The name of a security group associated with the
1233
- # network interface.
1234
- #
1235
- # * `ipv6-addresses.ipv6-address` - An IPv6 address associated with the
1236
- # network interface.
1237
- #
1238
- # * `mac-address` - The MAC address of the network interface.
1239
- #
1240
- # * `network-interface-id` - The ID of the network interface.
1241
- #
1242
- # * `owner-id` - The AWS account ID of the network interface owner.
1243
- #
1244
- # * `private-ip-address` - The private IPv4 address or addresses of the
1245
- # network interface.
1246
- #
1247
- # * `private-dns-name` - The private DNS name of the network interface
1248
- # (IPv4).
1249
- #
1250
- # * `requester-id` - The ID of the entity that launched the instance on
1251
- # your behalf (for example, AWS Management Console, Auto Scaling, and
1252
- # so on).
1253
- #
1254
- # * `requester-managed` - Indicates whether the network interface is
1255
- # being managed by an AWS service (for example, AWS Management
1256
- # Console, Auto Scaling, and so on).
1257
- #
1258
- # * `source-desk-check` - Indicates whether the network interface
1259
- # performs source/destination checking. A value of `true` means
1260
- # checking is enabled, and `false` means checking is disabled. The
1261
- # value must be `false` for the network interface to perform network
1262
- # address translation (NAT) in your VPC.
1263
- #
1264
- # * `status` - The status of the network interface. If the network
1265
- # interface is not attached to an instance, the status is `available`;
1266
- # if a network interface is attached to an instance the status is
1267
- # `in-use`.
1268
- #
1269
- # * `subnet-id` - The ID of the subnet for the network interface.
1270
- #
1271
- # * `tag`\:*key*=*value* - The key/value combination of a tag assigned
1272
- # to the resource.
1273
- #
1274
- # * `tag-key` - The key of a tag assigned to the resource. This filter
1275
- # is independent of the `tag-value` filter. For example, if you use
1276
- # both the filter "tag-key=Purpose" and the filter "tag-value=X",
1277
- # you get any resources assigned both the tag key Purpose (regardless
1278
- # of what the tag's value is), and the tag value X (regardless of
1279
- # what the tag's key is). If you want to list only resources where
1280
- # Purpose is X, see the `tag`\:*key*=*value* filter.
1281
- #
1282
- # * `tag-value` - The value of a tag assigned to the resource. This
1283
- # filter is independent of the `tag-key` filter.
1284
- #
1285
- # * `vpc-id` - The ID of the VPC for the network interface.
1286
- # @return [NetworkInterface::Collection]
1287
- def network_interfaces(options = {})
1288
- batches = Enumerator.new do |y|
1289
- batch = []
1290
- options = Aws::Util.deep_merge(options, filters: [{
1291
- name: "vpc-id",
1292
- values: [@id]
1293
- }])
1294
- resp = @client.describe_network_interfaces(options)
1295
- resp.data.network_interfaces.each do |n|
1296
- batch << NetworkInterface.new(
1297
- id: n.network_interface_id,
1298
- data: n,
1299
- client: @client
1300
- )
1301
- end
1302
- y.yield(batch)
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
- NetworkInterface::Collection.new(batches)
1316
+ y.yield(batch)
1305
1317
  end
1318
+ NetworkInterface::Collection.new(batches)
1319
+ end
1306
1320
 
1307
- # @example Request syntax with placeholder values
1308
- #
1309
- # requestedvpcpeeringconnections = vpc.requested_vpc_peering_connections({
1310
- # dry_run: false,
1311
- # vpc_peering_connection_ids: ["String"],
1312
- # filters: [
1313
- # {
1314
- # name: "String",
1315
- # values: ["String"],
1316
- # },
1317
- # ],
1318
- # })
1319
- # @param [Hash] options ({})
1320
- # @option options [Boolean] :dry_run
1321
- # Checks whether you have the required permissions for the action,
1322
- # without actually making the request, and provides an error response.
1323
- # If you have the required permissions, the error response is
1324
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
1325
- # @option options [Array<String>] :vpc_peering_connection_ids
1326
- # One or more VPC peering connection IDs.
1327
- #
1328
- # Default: Describes all your VPC peering connections.
1329
- # @option options [Array<Types::Filter>] :filters
1330
- # One or more filters.
1331
- #
1332
- # * `accepter-vpc-info.cidr-block` - The IPv4 CIDR block of the peer
1333
- # VPC.
1334
- #
1335
- # * `accepter-vpc-info.owner-id` - The AWS account ID of the owner of
1336
- # the peer VPC.
1337
- #
1338
- # * `accepter-vpc-info.vpc-id` - The ID of the peer VPC.
1339
- #
1340
- # * `expiration-time` - The expiration date and time for the VPC peering
1341
- # connection.
1342
- #
1343
- # * `requester-vpc-info.cidr-block` - The IPv4 CIDR block of the
1344
- # requester's VPC.
1345
- #
1346
- # * `requester-vpc-info.owner-id` - The AWS account ID of the owner of
1347
- # the requester VPC.
1348
- #
1349
- # * `requester-vpc-info.vpc-id` - The ID of the requester VPC.
1350
- #
1351
- # * `status-code` - The status of the VPC peering connection
1352
- # (`pending-acceptance` \| `failed` \| `expired` \| `provisioning` \|
1353
- # `active` \| `deleted` \| `rejected`).
1354
- #
1355
- # * `status-message` - A message that provides more information about
1356
- # the status of the VPC peering connection, if applicable.
1357
- #
1358
- # * `tag`\:*key*=*value* - The key/value combination of a tag assigned
1359
- # to the resource.
1360
- #
1361
- # * `tag-key` - The key of a tag assigned to the resource. This filter
1362
- # is independent of the `tag-value` filter. For example, if you use
1363
- # both the filter "tag-key=Purpose" and the filter "tag-value=X",
1364
- # you get any resources assigned both the tag key Purpose (regardless
1365
- # of what the tag's value is), and the tag value X (regardless of
1366
- # what the tag's key is). If you want to list only resources where
1367
- # Purpose is X, see the `tag`\:*key*=*value* filter.
1368
- #
1369
- # * `tag-value` - The value of a tag assigned to the resource. This
1370
- # filter is independent of the `tag-key` filter.
1371
- #
1372
- # * `vpc-peering-connection-id` - The ID of the VPC peering connection.
1373
- # @return [VpcPeeringConnection::Collection]
1374
- def requested_vpc_peering_connections(options = {})
1375
- batches = Enumerator.new do |y|
1376
- batch = []
1377
- options = Aws::Util.deep_merge(options, filters: [{
1378
- name: "requester-vpc-info.vpc-id",
1379
- values: [@id]
1380
- }])
1381
- resp = @client.describe_vpc_peering_connections(options)
1382
- resp.data.vpc_peering_connections.each do |v|
1383
- batch << VpcPeeringConnection.new(
1384
- id: v.vpc_peering_connection_id,
1385
- data: v,
1386
- client: @client
1387
- )
1388
- end
1389
- y.yield(batch)
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
- VpcPeeringConnection::Collection.new(batches)
1406
+ y.yield(batch)
1392
1407
  end
1408
+ VpcPeeringConnection::Collection.new(batches)
1409
+ end
1393
1410
 
1394
- # @example Request syntax with placeholder values
1395
- #
1396
- # routetables = vpc.route_tables({
1397
- # dry_run: false,
1398
- # route_table_ids: ["String"],
1399
- # filters: [
1400
- # {
1401
- # name: "String",
1402
- # values: ["String"],
1403
- # },
1404
- # ],
1405
- # })
1406
- # @param [Hash] options ({})
1407
- # @option options [Boolean] :dry_run
1408
- # Checks whether you have the required permissions for the action,
1409
- # without actually making the request, and provides an error response.
1410
- # If you have the required permissions, the error response is
1411
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
1412
- # @option options [Array<String>] :route_table_ids
1413
- # One or more route table IDs.
1414
- #
1415
- # Default: Describes all your route tables.
1416
- # @option options [Array<Types::Filter>] :filters
1417
- # One or more filters.
1418
- #
1419
- # * `association.route-table-association-id` - The ID of an association
1420
- # ID for the route table.
1421
- #
1422
- # * `association.route-table-id` - The ID of the route table involved in
1423
- # the association.
1424
- #
1425
- # * `association.subnet-id` - The ID of the subnet involved in the
1426
- # association.
1427
- #
1428
- # * `association.main` - Indicates whether the route table is the main
1429
- # route table for the VPC (`true` \| `false`).
1430
- #
1431
- # * `route-table-id` - The ID of the route table.
1432
- #
1433
- # * `route.destination-cidr-block` - The IPv4 CIDR range specified in a
1434
- # route in the table.
1435
- #
1436
- # * `route.destination-ipv6-cidr-block` - The IPv6 CIDR range specified
1437
- # in a route in the route table.
1438
- #
1439
- # * `route.destination-prefix-list-id` - The ID (prefix) of the AWS
1440
- # service specified in a route in the table.
1441
- #
1442
- # * `route.egress-only-internet-gateway-id` - The ID of an egress-only
1443
- # Internet gateway specified in a route in the route table.
1444
- #
1445
- # * `route.gateway-id` - The ID of a gateway specified in a route in the
1446
- # table.
1447
- #
1448
- # * `route.instance-id` - The ID of an instance specified in a route in
1449
- # the table.
1450
- #
1451
- # * `route.nat-gateway-id` - The ID of a NAT gateway.
1452
- #
1453
- # * `route.origin` - Describes how the route was created.
1454
- # `CreateRouteTable` indicates that the route was automatically
1455
- # created when the route table was created; `CreateRoute` indicates
1456
- # that the route was manually added to the route table;
1457
- # `EnableVgwRoutePropagation` indicates that the route was propagated
1458
- # by route propagation.
1459
- #
1460
- # * `route.state` - The state of a route in the route table (`active` \|
1461
- # `blackhole`). The blackhole state indicates that the route's target
1462
- # isn't available (for example, the specified gateway isn't attached
1463
- # to the VPC, the specified NAT instance has been terminated, and so
1464
- # on).
1465
- #
1466
- # * `route.vpc-peering-connection-id` - The ID of a VPC peering
1467
- # connection specified in a route in the table.
1468
- #
1469
- # * `tag`\:*key*=*value* - The key/value combination of a tag assigned
1470
- # to the resource.
1471
- #
1472
- # * `tag-key` - The key of a tag assigned to the resource. This filter
1473
- # is independent of the `tag-value` filter. For example, if you use
1474
- # both the filter "tag-key=Purpose" and the filter "tag-value=X",
1475
- # you get any resources assigned both the tag key Purpose (regardless
1476
- # of what the tag's value is), and the tag value X (regardless of
1477
- # what the tag's key is). If you want to list only resources where
1478
- # Purpose is X, see the `tag`\:*key*=*value* filter.
1479
- #
1480
- # * `tag-value` - The value of a tag assigned to the resource. This
1481
- # filter is independent of the `tag-key` filter.
1482
- #
1483
- # * `vpc-id` - The ID of the VPC for the route table.
1484
- # @return [RouteTable::Collection]
1485
- def route_tables(options = {})
1486
- batches = Enumerator.new do |y|
1487
- batch = []
1488
- options = Aws::Util.deep_merge(options, filters: [{
1489
- name: "vpc-id",
1490
- values: [@id]
1491
- }])
1492
- resp = @client.describe_route_tables(options)
1493
- resp.data.route_tables.each do |r|
1494
- batch << RouteTable.new(
1495
- id: r.route_table_id,
1496
- data: r,
1497
- client: @client
1498
- )
1499
- end
1500
- y.yield(batch)
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
- RouteTable::Collection.new(batches)
1520
+ y.yield(batch)
1503
1521
  end
1522
+ RouteTable::Collection.new(batches)
1523
+ end
1504
1524
 
1505
- # @example Request syntax with placeholder values
1506
- #
1507
- # securitygroups = vpc.security_groups({
1508
- # dry_run: false,
1509
- # group_names: ["String"],
1510
- # group_ids: ["String"],
1511
- # filters: [
1512
- # {
1513
- # name: "String",
1514
- # values: ["String"],
1515
- # },
1516
- # ],
1517
- # })
1518
- # @param [Hash] options ({})
1519
- # @option options [Boolean] :dry_run
1520
- # Checks whether you have the required permissions for the action,
1521
- # without actually making the request, and provides an error response.
1522
- # If you have the required permissions, the error response is
1523
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
1524
- # @option options [Array<String>] :group_names
1525
- # \[EC2-Classic and default VPC only\] One or more security group names.
1526
- # You can specify either the security group name or the security group
1527
- # ID. For security groups in a nondefault VPC, use the `group-name`
1528
- # filter to describe security groups by name.
1529
- #
1530
- # Default: Describes all your security groups.
1531
- # @option options [Array<String>] :group_ids
1532
- # One or more security group IDs. Required for security groups in a
1533
- # nondefault VPC.
1534
- #
1535
- # Default: Describes all your security groups.
1536
- # @option options [Array<Types::Filter>] :filters
1537
- # One or more filters. If using multiple filters for rules, the results
1538
- # include security groups for which any combination of rules - not
1539
- # necessarily a single rule - match all filters.
1540
- #
1541
- # * `description` - The description of the security group.
1542
- #
1543
- # * `egress.ip-permission.prefix-list-id` - The ID (prefix) of the AWS
1544
- # service to which the security group allows access.
1545
- #
1546
- # * `group-id` - The ID of the security group.
1547
- #
1548
- # * `group-name` - The name of the security group.
1549
- #
1550
- # * `ip-permission.cidr` - An IPv4 CIDR range that has been granted
1551
- # permission in a security group rule.
1552
- #
1553
- # * `ip-permission.from-port` - The start of port range for the TCP and
1554
- # UDP protocols, or an ICMP type number.
1555
- #
1556
- # * `ip-permission.group-id` - The ID of a security group that has been
1557
- # granted permission.
1558
- #
1559
- # * `ip-permission.group-name` - The name of a security group that has
1560
- # been granted permission.
1561
- #
1562
- # * `ip-permission.ipv6-cidr` - An IPv6 CIDR range that has been granted
1563
- # permission in a security group rule.
1564
- #
1565
- # * `ip-permission.protocol` - The IP protocol for the permission (`tcp`
1566
- # \| `udp` \| `icmp` or a protocol number).
1567
- #
1568
- # * `ip-permission.to-port` - The end of port range for the TCP and UDP
1569
- # protocols, or an ICMP code.
1570
- #
1571
- # * `ip-permission.user-id` - The ID of an AWS account that has been
1572
- # granted permission.
1573
- #
1574
- # * `owner-id` - The AWS account ID of the owner of the security group.
1575
- #
1576
- # * `tag-key` - The key of a tag assigned to the security group.
1577
- #
1578
- # * `tag-value` - The value of a tag assigned to the security group.
1579
- #
1580
- # * `vpc-id` - The ID of the VPC specified when the security group was
1581
- # created.
1582
- # @return [SecurityGroup::Collection]
1583
- def security_groups(options = {})
1584
- batches = Enumerator.new do |y|
1585
- batch = []
1586
- options = Aws::Util.deep_merge(options, filters: [{
1587
- name: "vpc-id",
1588
- values: [@id]
1589
- }])
1590
- resp = @client.describe_security_groups(options)
1591
- resp.data.security_groups.each do |s|
1592
- batch << SecurityGroup.new(
1593
- id: s.group_id,
1594
- data: s,
1595
- client: @client
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
- SecurityGroup::Collection.new(batches)
1618
+ y.yield(batch)
1601
1619
  end
1620
+ SecurityGroup::Collection.new(batches)
1621
+ end
1602
1622
 
1603
- # @example Request syntax with placeholder values
1604
- #
1605
- # subnets = vpc.subnets({
1606
- # dry_run: false,
1607
- # subnet_ids: ["String"],
1608
- # filters: [
1609
- # {
1610
- # name: "String",
1611
- # values: ["String"],
1612
- # },
1613
- # ],
1614
- # })
1615
- # @param [Hash] options ({})
1616
- # @option options [Boolean] :dry_run
1617
- # Checks whether you have the required permissions for the action,
1618
- # without actually making the request, and provides an error response.
1619
- # If you have the required permissions, the error response is
1620
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
1621
- # @option options [Array<String>] :subnet_ids
1622
- # One or more subnet IDs.
1623
- #
1624
- # Default: Describes all your subnets.
1625
- # @option options [Array<Types::Filter>] :filters
1626
- # One or more filters.
1627
- #
1628
- # * `availabilityZone` - The Availability Zone for the subnet. You can
1629
- # also use `availability-zone` as the filter name.
1630
- #
1631
- # * `available-ip-address-count` - The number of IPv4 addresses in the
1632
- # subnet that are available.
1633
- #
1634
- # * `cidrBlock` - The IPv4 CIDR block of the subnet. The CIDR block you
1635
- # specify must exactly match the subnet's CIDR block for information
1636
- # to be returned for the subnet. You can also use `cidr` or
1637
- # `cidr-block` as the filter names.
1638
- #
1639
- # * `defaultForAz` - Indicates whether this is the default subnet for
1640
- # the Availability Zone. You can also use `default-for-az` as the
1641
- # filter name.
1642
- #
1643
- # * `ipv6-cidr-block-association.ipv6-cidr-block` - An IPv6 CIDR block
1644
- # associated with the subnet.
1645
- #
1646
- # * `ipv6-cidr-block-association.association-id` - An association ID for
1647
- # an IPv6 CIDR block associated with the subnet.
1648
- #
1649
- # * `ipv6-cidr-block-association.state` - The state of an IPv6 CIDR
1650
- # block associated with the subnet.
1651
- #
1652
- # * `state` - The state of the subnet (`pending` \| `available`).
1653
- #
1654
- # * `subnet-id` - The ID of the subnet.
1655
- #
1656
- # * `tag`\:*key*=*value* - The key/value combination of a tag assigned
1657
- # to the resource.
1658
- #
1659
- # * `tag-key` - The key of a tag assigned to the resource. This filter
1660
- # is independent of the `tag-value` filter. For example, if you use
1661
- # both the filter "tag-key=Purpose" and the filter "tag-value=X",
1662
- # you get any resources assigned both the tag key Purpose (regardless
1663
- # of what the tag's value is), and the tag value X (regardless of
1664
- # what the tag's key is). If you want to list only resources where
1665
- # Purpose is X, see the `tag`\:*key*=*value* filter.
1666
- #
1667
- # * `tag-value` - The value of a tag assigned to the resource. This
1668
- # filter is independent of the `tag-key` filter.
1669
- #
1670
- # * `vpc-id` - The ID of the VPC for the subnet.
1671
- # @return [Subnet::Collection]
1672
- def subnets(options = {})
1673
- batches = Enumerator.new do |y|
1674
- batch = []
1675
- options = Aws::Util.deep_merge(options, filters: [{
1676
- name: "vpc-id",
1677
- values: [@id]
1678
- }])
1679
- resp = @client.describe_subnets(options)
1680
- resp.data.subnets.each do |s|
1681
- batch << Subnet.new(
1682
- id: s.subnet_id,
1683
- data: s,
1684
- client: @client
1685
- )
1686
- end
1687
- y.yield(batch)
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
- Subnet::Collection.new(batches)
1710
+ y.yield(batch)
1690
1711
  end
1712
+ Subnet::Collection.new(batches)
1713
+ end
1691
1714
 
1692
- # @deprecated
1693
- # @api private
1694
- def identifiers
1695
- { id: @id }
1696
- end
1697
- deprecated(:identifiers)
1715
+ # @deprecated
1716
+ # @api private
1717
+ def identifiers
1718
+ { id: @id }
1719
+ end
1720
+ deprecated(:identifiers)
1698
1721
 
1699
- private
1722
+ private
1700
1723
 
1701
- def extract_id(args, options)
1702
- value = args[0] || options.delete(:id)
1703
- case value
1704
- when String then value
1705
- when nil then raise ArgumentError, "missing required option :id"
1706
- else
1707
- msg = "expected :id to be a String, got #{value.class}"
1708
- raise ArgumentError, msg
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
- def yield_waiter_and_warn(waiter, &block)
1713
- if !@waiter_block_warned
1714
- msg = "pass options to configure the waiter; "
1715
- msg << "yielding the waiter is deprecated"
1716
- warn(msg)
1717
- @waiter_block_warned = true
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
- def separate_params_and_options(options)
1723
- opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
1724
- waiter_opts = {}
1725
- waiter_params = {}
1726
- options.each_pair do |key, value|
1727
- if opts.include?(key)
1728
- waiter_opts[key] = value
1729
- else
1730
- waiter_params[key] = value
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
- class Collection < Aws::Resources::Collection; end
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