aws-sdk-ec2 1.285.0 → 1.417.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +663 -1
  3. data/VERSION +1 -1
  4. data/lib/aws-sdk-ec2/classic_address.rb +33 -36
  5. data/lib/aws-sdk-ec2/client.rb +13859 -2170
  6. data/lib/aws-sdk-ec2/client_api.rb +4203 -86
  7. data/lib/aws-sdk-ec2/customizations/instance.rb +3 -1
  8. data/lib/aws-sdk-ec2/customizations/resource.rb +3 -1
  9. data/lib/aws-sdk-ec2/dhcp_options.rb +19 -7
  10. data/lib/aws-sdk-ec2/endpoint_parameters.rb +66 -0
  11. data/lib/aws-sdk-ec2/endpoint_provider.rb +57 -0
  12. data/lib/aws-sdk-ec2/endpoints.rb +8444 -0
  13. data/lib/aws-sdk-ec2/image.rb +96 -22
  14. data/lib/aws-sdk-ec2/instance.rb +232 -95
  15. data/lib/aws-sdk-ec2/internet_gateway.rb +21 -7
  16. data/lib/aws-sdk-ec2/key_pair.rb +13 -4
  17. data/lib/aws-sdk-ec2/key_pair_info.rb +32 -4
  18. data/lib/aws-sdk-ec2/nat_gateway.rb +22 -12
  19. data/lib/aws-sdk-ec2/network_acl.rb +28 -10
  20. data/lib/aws-sdk-ec2/network_interface.rb +76 -17
  21. data/lib/aws-sdk-ec2/network_interface_association.rb +11 -5
  22. data/lib/aws-sdk-ec2/placement_group.rb +198 -33
  23. data/lib/aws-sdk-ec2/plugins/copy_encrypted_snapshot.rb +17 -12
  24. data/lib/aws-sdk-ec2/plugins/endpoints.rb +1272 -0
  25. data/lib/aws-sdk-ec2/plugins/region_validation.rb +1 -1
  26. data/lib/aws-sdk-ec2/resource.rb +793 -282
  27. data/lib/aws-sdk-ec2/route.rb +9 -3
  28. data/lib/aws-sdk-ec2/route_table.rb +21 -7
  29. data/lib/aws-sdk-ec2/route_table_association.rb +9 -3
  30. data/lib/aws-sdk-ec2/security_group.rb +74 -57
  31. data/lib/aws-sdk-ec2/snapshot.rb +38 -12
  32. data/lib/aws-sdk-ec2/subnet.rb +394 -137
  33. data/lib/aws-sdk-ec2/tag.rb +12 -4
  34. data/lib/aws-sdk-ec2/types.rb +15645 -13412
  35. data/lib/aws-sdk-ec2/volume.rb +65 -34
  36. data/lib/aws-sdk-ec2/vpc.rb +368 -123
  37. data/lib/aws-sdk-ec2/vpc_address.rb +29 -34
  38. data/lib/aws-sdk-ec2/vpc_peering_connection.rb +18 -6
  39. data/lib/aws-sdk-ec2/waiters.rb +184 -0
  40. data/lib/aws-sdk-ec2.rb +6 -2
  41. metadata +8 -4
@@ -66,6 +66,19 @@ module Aws::EC2
66
66
  data[:tags]
67
67
  end
68
68
 
69
+ # The Amazon Resource Name (ARN) of the placement group.
70
+ # @return [String]
71
+ def group_arn
72
+ data[:group_arn]
73
+ end
74
+
75
+ # The spread level for the placement group. *Only* Outpost placement
76
+ # groups can be spread across hosts.
77
+ # @return [String]
78
+ def spread_level
79
+ data[:spread_level]
80
+ end
81
+
69
82
  # @!endgroup
70
83
 
71
84
  # @return [Client]
@@ -80,7 +93,9 @@ module Aws::EC2
80
93
  #
81
94
  # @return [self]
82
95
  def load
83
- resp = @client.describe_placement_groups(group_names: [@name])
96
+ resp = Aws::Plugins::UserAgent.feature('resource') do
97
+ @client.describe_placement_groups(group_names: [@name])
98
+ end
84
99
  @data = resp.placement_groups[0]
85
100
  self
86
101
  end
@@ -195,7 +210,9 @@ module Aws::EC2
195
210
  :retry
196
211
  end
197
212
  end
198
- Aws::Waiters::Waiter.new(options).wait({})
213
+ Aws::Plugins::UserAgent.feature('resource') do
214
+ Aws::Waiters::Waiter.new(options).wait({})
215
+ end
199
216
  end
200
217
 
201
218
  # @!group Actions
@@ -214,7 +231,9 @@ module Aws::EC2
214
231
  # @return [EmptyStructure]
215
232
  def delete(options = {})
216
233
  options = options.merge(group_name: @name)
217
- resp = @client.delete_placement_group(options)
234
+ resp = Aws::Plugins::UserAgent.feature('resource') do
235
+ @client.delete_placement_group(options)
236
+ end
218
237
  resp.data
219
238
  end
220
239
 
@@ -246,7 +265,7 @@ module Aws::EC2
246
265
  #
247
266
  # * `block-device-mapping.attach-time` - The attach time for an EBS
248
267
  # volume mapped to the instance, for example,
249
- # `2010-09-15T17:15:20.000Z`.
268
+ # `2022-09-15T17:15:20.000Z`.
250
269
  #
251
270
  # * `block-device-mapping.delete-on-termination` - A Boolean that
252
271
  # indicates whether the EBS volume is deleted on instance termination.
@@ -259,16 +278,38 @@ module Aws::EC2
259
278
  #
260
279
  # * `block-device-mapping.volume-id` - The volume ID of the EBS volume.
261
280
  #
281
+ # * `boot-mode` - The boot mode that was specified by the AMI
282
+ # (`legacy-bios` \| `uefi` \| `uefi-preferred`).
283
+ #
284
+ # * `capacity-reservation-id` - The ID of the Capacity Reservation into
285
+ # which the instance was launched.
286
+ #
287
+ # * `capacity-reservation-specification.capacity-reservation-preference`
288
+ # - The instance's Capacity Reservation preference (`open` \|
289
+ # `none`).
290
+ #
291
+ # * `capacity-reservation-specification.capacity-reservation-target.capacity-reservation-id`
292
+ # - The ID of the targeted Capacity Reservation.
293
+ #
294
+ # * `capacity-reservation-specification.capacity-reservation-target.capacity-reservation-resource-group-arn`
295
+ # - The ARN of the targeted Capacity Reservation group.
296
+ #
262
297
  # * `client-token` - The idempotency token you provided when you
263
298
  # launched the instance.
264
299
  #
300
+ # * `current-instance-boot-mode` - The boot mode that is used to launch
301
+ # the instance at launch or start (`legacy-bios` \| `uefi`).
302
+ #
265
303
  # * `dns-name` - The public DNS name of the instance.
266
304
  #
267
- # * `group-id` - The ID of the security group for the instance.
268
- # EC2-Classic only.
305
+ # * `ebs-optimized` - A Boolean that indicates whether the instance is
306
+ # optimized for Amazon EBS I/O.
307
+ #
308
+ # * `ena-support` - A Boolean that indicates whether the instance is
309
+ # enabled for enhanced networking with ENA.
269
310
  #
270
- # * `group-name` - The name of the security group for the instance.
271
- # EC2-Classic only.
311
+ # * `enclave-options.enabled` - A Boolean that indicates whether the
312
+ # instance is enabled for Amazon Web Services Nitro Enclaves.
272
313
  #
273
314
  # * `hibernation-options.configured` - A Boolean that indicates whether
274
315
  # the instance is enabled for hibernation. A value of `true` means
@@ -283,6 +324,12 @@ module Aws::EC2
283
324
  # * `iam-instance-profile.arn` - The instance profile associated with
284
325
  # the instance. Specified as an ARN.
285
326
  #
327
+ # * `iam-instance-profile.id` - The instance profile associated with the
328
+ # instance. Specified as an ID.
329
+ #
330
+ # * `iam-instance-profile.name` - The instance profile associated with
331
+ # the instance. Specified as an name.
332
+ #
286
333
  # * `image-id` - The ID of the image used to launch the instance.
287
334
  #
288
335
  # * `instance-id` - The ID of the instance.
@@ -309,6 +356,8 @@ module Aws::EC2
309
356
  #
310
357
  # * `ip-address` - The public IPv4 address of the instance.
311
358
  #
359
+ # * `ipv6-address` - The IPv6 address of the instance.
360
+ #
312
361
  # * `kernel-id` - The kernel ID.
313
362
  #
314
363
  # * `key-name` - The name of the key pair used when the instance was
@@ -323,38 +372,65 @@ module Aws::EC2
323
372
  # example, `2021-09-29T11:04:43.305Z`. You can use a wildcard (`*`),
324
373
  # for example, `2021-09-29T*`, which matches an entire day.
325
374
  #
326
- # * `metadata-options.http-tokens` - The metadata request authorization
327
- # state (`optional` \| `required`)
375
+ # * `maintenance-options.auto-recovery` - The current automatic recovery
376
+ # behavior of the instance (`disabled` \| `default`).
377
+ #
378
+ # * `metadata-options.http-endpoint` - The status of access to the HTTP
379
+ # metadata endpoint on your instance (`enabled` \| `disabled`)
328
380
  #
329
- # * `metadata-options.http-put-response-hop-limit` - The http metadata
381
+ # * `metadata-options.http-protocol-ipv4` - Indicates whether the IPv4
382
+ # endpoint is enabled (`disabled` \| `enabled`).
383
+ #
384
+ # * `metadata-options.http-protocol-ipv6` - Indicates whether the IPv6
385
+ # endpoint is enabled (`disabled` \| `enabled`).
386
+ #
387
+ # * `metadata-options.http-put-response-hop-limit` - The HTTP metadata
330
388
  # request put response hop limit (integer, possible values `1` to
331
389
  # `64`)
332
390
  #
333
- # * `metadata-options.http-endpoint` - Enable or disable metadata access
334
- # on http endpoint (`enabled` \| `disabled`)
391
+ # * `metadata-options.http-tokens` - The metadata request authorization
392
+ # state (`optional` \| `required`)
393
+ #
394
+ # * `metadata-options.instance-metadata-tags` - The status of access to
395
+ # instance tags from the instance metadata (`enabled` \| `disabled`)
396
+ #
397
+ # * `metadata-options.state` - The state of the metadata option changes
398
+ # (`pending` \| `applied`).
335
399
  #
336
400
  # * `monitoring-state` - Indicates whether detailed monitoring is
337
401
  # enabled (`disabled` \| `enabled`).
338
402
  #
339
- # * `network-interface.addresses.private-ip-address` - The private IPv4
340
- # address associated with the network interface.
403
+ # * `network-interface.addresses.association.allocation-id` - The
404
+ # allocation ID.
341
405
  #
342
- # * `network-interface.addresses.primary` - Specifies whether the IPv4
343
- # address of the network interface is the primary private IPv4
344
- # address.
406
+ # * `network-interface.addresses.association.association-id` - The
407
+ # association ID.
408
+ #
409
+ # * `network-interface.addresses.association.carrier-ip` - The carrier
410
+ # IP address.
411
+ #
412
+ # * `network-interface.addresses.association.customer-owned-ip` - The
413
+ # customer-owned IP address.
414
+ #
415
+ # * `network-interface.addresses.association.ip-owner-id` - The owner ID
416
+ # of the private IPv4 address associated with the network interface.
417
+ #
418
+ # * `network-interface.addresses.association.public-dns-name` - The
419
+ # public DNS name.
345
420
  #
346
421
  # * `network-interface.addresses.association.public-ip` - The ID of the
347
422
  # association of an Elastic IP address (IPv4) with a network
348
423
  # interface.
349
424
  #
350
- # * `network-interface.addresses.association.ip-owner-id` - The owner ID
351
- # of the private IPv4 address associated with the network interface.
425
+ # * `network-interface.addresses.primary` - Specifies whether the IPv4
426
+ # address of the network interface is the primary private IPv4
427
+ # address.
352
428
  #
353
- # * `network-interface.association.public-ip` - The address of the
354
- # Elastic IP address (IPv4) bound to the network interface.
429
+ # * `network-interface.addresses.private-dns-name` - The private DNS
430
+ # name.
355
431
  #
356
- # * `network-interface.association.ip-owner-id` - The owner of the
357
- # Elastic IP address (IPv4) associated with the network interface.
432
+ # * `network-interface.addresses.private-ip-address` - The private IPv4
433
+ # address associated with the network interface.
358
434
  #
359
435
  # * `network-interface.association.allocation-id` - The allocation ID
360
436
  # returned when you allocated the Elastic IP address (IPv4) for your
@@ -364,30 +440,52 @@ module Aws::EC2
364
440
  # returned when the network interface was associated with an IPv4
365
441
  # address.
366
442
  #
443
+ # * `network-interface.association.carrier-ip` - The customer-owned IP
444
+ # address.
445
+ #
446
+ # * `network-interface.association.customer-owned-ip` - The
447
+ # customer-owned IP address.
448
+ #
449
+ # * `network-interface.association.ip-owner-id` - The owner of the
450
+ # Elastic IP address (IPv4) associated with the network interface.
451
+ #
452
+ # * `network-interface.association.public-dns-name` - The public DNS
453
+ # name.
454
+ #
455
+ # * `network-interface.association.public-ip` - The address of the
456
+ # Elastic IP address (IPv4) bound to the network interface.
457
+ #
458
+ # * `network-interface.attachment.attach-time` - The time that the
459
+ # network interface was attached to an instance.
460
+ #
367
461
  # * `network-interface.attachment.attachment-id` - The ID of the
368
462
  # interface attachment.
369
463
  #
464
+ # * `network-interface.attachment.delete-on-termination` - Specifies
465
+ # whether the attachment is deleted when an instance is terminated.
466
+ #
467
+ # * `network-interface.attachment.device-index` - The device index to
468
+ # which the network interface is attached.
469
+ #
370
470
  # * `network-interface.attachment.instance-id` - The ID of the instance
371
471
  # to which the network interface is attached.
372
472
  #
373
473
  # * `network-interface.attachment.instance-owner-id` - The owner ID of
374
474
  # the instance to which the network interface is attached.
375
475
  #
376
- # * `network-interface.attachment.device-index` - The device index to
377
- # which the network interface is attached.
476
+ # * `network-interface.attachment.network-card-index` - The index of the
477
+ # network card.
378
478
  #
379
479
  # * `network-interface.attachment.status` - The status of the attachment
380
480
  # (`attaching` \| `attached` \| `detaching` \| `detached`).
381
481
  #
382
- # * `network-interface.attachment.attach-time` - The time that the
383
- # network interface was attached to an instance.
384
- #
385
- # * `network-interface.attachment.delete-on-termination` - Specifies
386
- # whether the attachment is deleted when an instance is terminated.
387
- #
388
482
  # * `network-interface.availability-zone` - The Availability Zone for
389
483
  # the network interface.
390
484
  #
485
+ # * `network-interface.deny-all-igw-traffic` - A Boolean that indicates
486
+ # whether a network interface with an IPv6 address is unreachable from
487
+ # the public internet.
488
+ #
391
489
  # * `network-interface.description` - The description of the network
392
490
  # interface.
393
491
  #
@@ -397,21 +495,42 @@ module Aws::EC2
397
495
  # * `network-interface.group-name` - The name of a security group
398
496
  # associated with the network interface.
399
497
  #
498
+ # * `network-interface.ipv4-prefixes.ipv4-prefix` - The IPv4 prefixes
499
+ # that are assigned to the network interface.
500
+ #
501
+ # * `network-interface.ipv6-address` - The IPv6 address associated with
502
+ # the network interface.
503
+ #
400
504
  # * `network-interface.ipv6-addresses.ipv6-address` - The IPv6 address
401
505
  # associated with the network interface.
402
506
  #
507
+ # * `network-interface.ipv6-addresses.is-primary-ipv6` - A Boolean that
508
+ # indicates whether this is the primary IPv6 address.
509
+ #
510
+ # * `network-interface.ipv6-native` - A Boolean that indicates whether
511
+ # this is an IPv6 only network interface.
512
+ #
513
+ # * `network-interface.ipv6-prefixes.ipv6-prefix` - The IPv6 prefix
514
+ # assigned to the network interface.
515
+ #
403
516
  # * `network-interface.mac-address` - The MAC address of the network
404
517
  # interface.
405
518
  #
406
519
  # * `network-interface.network-interface-id` - The ID of the network
407
520
  # interface.
408
521
  #
522
+ # * `network-interface.outpost-arn` - The ARN of the Outpost.
523
+ #
409
524
  # * `network-interface.owner-id` - The ID of the owner of the network
410
525
  # interface.
411
526
  #
412
527
  # * `network-interface.private-dns-name` - The private DNS name of the
413
528
  # network interface.
414
529
  #
530
+ # * `network-interface.private-ip-address` - The private IPv4 address.
531
+ #
532
+ # * `network-interface.public-dns-name` - The public DNS name.
533
+ #
415
534
  # * `network-interface.requester-id` - The requester ID for the network
416
535
  # interface.
417
536
  #
@@ -430,6 +549,12 @@ module Aws::EC2
430
549
  # * `network-interface.subnet-id` - The ID of the subnet for the network
431
550
  # interface.
432
551
  #
552
+ # * `network-interface.tag-key` - The key of a tag assigned to the
553
+ # network interface.
554
+ #
555
+ # * `network-interface.tag-value` - The value of a tag assigned to the
556
+ # network interface.
557
+ #
433
558
  # * `network-interface.vpc-id` - The ID of the VPC for the network
434
559
  # interface.
435
560
  #
@@ -447,8 +572,31 @@ module Aws::EC2
447
572
  # * `platform` - The platform. To list only Windows instances, use
448
573
  # `windows`.
449
574
  #
575
+ # * `platform-details` - The platform (`Linux/UNIX` \| `Red Hat BYOL
576
+ # Linux` \| ` Red Hat Enterprise Linux` \| `Red Hat Enterprise Linux
577
+ # with HA` \| `Red Hat Enterprise Linux with SQL Server Standard and
578
+ # HA` \| `Red Hat Enterprise Linux with SQL Server Enterprise and HA`
579
+ # \| `Red Hat Enterprise Linux with SQL Server Standard` \| `Red Hat
580
+ # Enterprise Linux with SQL Server Web` \| `Red Hat Enterprise Linux
581
+ # with SQL Server Enterprise` \| `SQL Server Enterprise` \| `SQL
582
+ # Server Standard` \| `SQL Server Web` \| `SUSE Linux` \| `Ubuntu Pro`
583
+ # \| `Windows` \| `Windows BYOL` \| `Windows with SQL Server
584
+ # Enterprise` \| `Windows with SQL Server Standard` \| `Windows with
585
+ # SQL Server Web`).
586
+ #
450
587
  # * `private-dns-name` - The private IPv4 DNS name of the instance.
451
588
  #
589
+ # * `private-dns-name-options.enable-resource-name-dns-a-record` - A
590
+ # Boolean that indicates whether to respond to DNS queries for
591
+ # instance hostnames with DNS A records.
592
+ #
593
+ # * `private-dns-name-options.enable-resource-name-dns-aaaa-record` - A
594
+ # Boolean that indicates whether to respond to DNS queries for
595
+ # instance hostnames with DNS AAAA records.
596
+ #
597
+ # * `private-dns-name-options.hostname-type` - The type of hostname
598
+ # (`ip-name` \| `resource-name`).
599
+ #
452
600
  # * `private-ip-address` - The private IPv4 address of the instance.
453
601
  #
454
602
  # * `product-code` - The product code associated with the AMI used to
@@ -509,6 +657,21 @@ module Aws::EC2
509
657
  # * `tenancy` - The tenancy of an instance (`dedicated` \| `default` \|
510
658
  # `host`).
511
659
  #
660
+ # * `tpm-support` - Indicates if the instance is configured for NitroTPM
661
+ # support (`v2.0`).
662
+ #
663
+ # * `usage-operation` - The usage operation value for the instance
664
+ # (`RunInstances` \| `RunInstances:00g0` \| `RunInstances:0010` \|
665
+ # `RunInstances:1010` \| `RunInstances:1014` \| `RunInstances:1110` \|
666
+ # `RunInstances:0014` \| `RunInstances:0210` \| `RunInstances:0110` \|
667
+ # `RunInstances:0100` \| `RunInstances:0004` \| `RunInstances:0200` \|
668
+ # `RunInstances:000g` \| `RunInstances:0g00` \| `RunInstances:0002` \|
669
+ # `RunInstances:0800` \| `RunInstances:0102` \| `RunInstances:0006` \|
670
+ # `RunInstances:0202`).
671
+ #
672
+ # * `usage-operation-update-time` - The time that the usage operation
673
+ # was last updated, for example, `2022-09-15T17:15:20.000Z`.
674
+ #
512
675
  # * `virtualization-type` - The virtualization type of the instance
513
676
  # (`paravirtual` \| `hvm`).
514
677
  #
@@ -529,7 +692,9 @@ module Aws::EC2
529
692
  name: "placement-group-name",
530
693
  values: [@name]
531
694
  }])
532
- resp = @client.describe_instances(options)
695
+ resp = Aws::Plugins::UserAgent.feature('resource') do
696
+ @client.describe_instances(options)
697
+ end
533
698
  resp.each_page do |page|
534
699
  batch = []
535
700
  page.data.reservations.each do |r|
@@ -21,6 +21,10 @@ module Aws
21
21
 
22
22
  def call(context)
23
23
  params = context.params
24
+ unless params[:source_region]
25
+ raise ArgumentError,
26
+ 'Source region is required for copy_snapshot'
27
+ end
24
28
  params[:destination_region] = context.config.region
25
29
  params[:presigned_url] = presigned_url(context, params)
26
30
  @handler.call(context)
@@ -33,25 +37,26 @@ module Aws
33
37
  param_list.set('Action', 'CopySnapshot')
34
38
  param_list.set('DestinationRegion', context.config.region)
35
39
  param_list.set('Version', context.config.api.version)
36
- Aws::Query::EC2ParamBuilder.new(param_list).apply(context.operation.input, params)
40
+ Aws::Query::EC2ParamBuilder.new(param_list).apply(
41
+ context.operation.input, params
42
+ )
37
43
 
38
- signer = Aws::Sigv4::Signer.new(
39
- service: 'ec2',
44
+ endpoint_params = Aws::EC2::EndpointParameters.new(
40
45
  region: params[:source_region],
41
- credentials_provider: context.config.credentials
46
+ use_dual_stack: context.config.use_dualstack_endpoint,
47
+ use_fips: context.config.use_fips_endpoint
42
48
  )
43
- url = Aws::Partitions::EndpointProvider.resolve(
44
- signer.region, 'ec2', 'regional',
45
- {
46
- dualstack: context.config.use_dualstack_endpoint,
47
- fips: context.config.use_fips_endpoint
48
- }
49
+ endpoint = context.config.endpoint_provider
50
+ .resolve_endpoint(endpoint_params)
51
+ auth_scheme = Aws::Endpoints.resolve_auth_scheme(context, endpoint)
52
+
53
+ signer = Aws::Plugins::Sign.signer_for(
54
+ auth_scheme, context.config, params[:source_region]
49
55
  )
50
- url += "?#{param_list.to_s}"
51
56
 
52
57
  signer.presign_url(
53
58
  http_method: 'GET',
54
- url: url,
59
+ url: "#{endpoint.url}?#{param_list}",
55
60
  body: '',
56
61
  expires_in: 3600
57
62
  ).to_s