aws-sdk-ec2 1.285.0 → 1.417.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -91,15 +91,15 @@ module Aws::EC2
91
91
  data[:platform]
92
92
  end
93
93
 
94
- # (IPv4 only) The private DNS hostname name assigned to the instance.
94
+ # \[IPv4 only\] The private DNS hostname name assigned to the instance.
95
95
  # This DNS hostname can only be used inside the Amazon EC2 network. This
96
96
  # name is not available until the instance enters the `running` state.
97
97
  #
98
- # \[EC2-VPC\] The Amazon-provided DNS server resolves Amazon-provided
99
- # private DNS hostnames if you've enabled DNS resolution and DNS
100
- # hostnames in your VPC. If you are not using the Amazon-provided DNS
101
- # server in your VPC, your custom domain name servers must resolve the
102
- # hostname as appropriate.
98
+ # The Amazon-provided DNS server resolves Amazon-provided private DNS
99
+ # hostnames if you've enabled DNS resolution and DNS hostnames in your
100
+ # VPC. If you are not using the Amazon-provided DNS server in your VPC,
101
+ # your custom domain name servers must resolve the hostname as
102
+ # appropriate.
103
103
  # @return [String]
104
104
  def private_dns_name
105
105
  data[:private_dns_name]
@@ -117,10 +117,9 @@ module Aws::EC2
117
117
  data[:product_codes]
118
118
  end
119
119
 
120
- # (IPv4 only) The public DNS name assigned to the instance. This name is
121
- # not available until the instance enters the `running` state. For
122
- # EC2-VPC, this name is only available if you've enabled DNS hostnames
123
- # for your VPC.
120
+ # \[IPv4 only\] The public DNS name assigned to the instance. This name
121
+ # is not available until the instance enters the `running` state. This
122
+ # name is only available if you've enabled DNS hostnames for your VPC.
124
123
  # @return [String]
125
124
  def public_dns_name
126
125
  data[:public_dns_name]
@@ -155,13 +154,13 @@ module Aws::EC2
155
154
  data[:state_transition_reason]
156
155
  end
157
156
 
158
- # \[EC2-VPC\] The ID of the subnet in which the instance is running.
157
+ # The ID of the subnet in which the instance is running.
159
158
  # @return [String]
160
159
  def subnet_id
161
160
  data[:subnet_id]
162
161
  end
163
162
 
164
- # \[EC2-VPC\] The ID of the VPC in which the instance is running.
163
+ # The ID of the VPC in which the instance is running.
165
164
  # @return [String]
166
165
  def vpc_id
167
166
  data[:vpc_id]
@@ -338,8 +337,18 @@ module Aws::EC2
338
337
  data[:enclave_options]
339
338
  end
340
339
 
341
- # The boot mode of the instance. For more information, see [Boot
342
- # modes][1] in the *Amazon EC2 User Guide*.
340
+ # The boot mode that was specified by the AMI. If the value is
341
+ # `uefi-preferred`, the AMI supports both UEFI and Legacy BIOS. The
342
+ # `currentInstanceBootMode` parameter is the boot mode that is used to
343
+ # boot the instance at launch or start.
344
+ #
345
+ # <note markdown="1"> The operating system contained in the AMI must be configured to
346
+ # support the specified boot mode.
347
+ #
348
+ # </note>
349
+ #
350
+ # For more information, see [Boot modes][1] in the *Amazon EC2 User
351
+ # Guide*.
343
352
  #
344
353
  #
345
354
  #
@@ -389,6 +398,37 @@ module Aws::EC2
389
398
  data[:ipv_6_address]
390
399
  end
391
400
 
401
+ # If the instance is configured for NitroTPM support, the value is
402
+ # `v2.0`. For more information, see [NitroTPM][1] in the *Amazon EC2
403
+ # User Guide*.
404
+ #
405
+ #
406
+ #
407
+ # [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html
408
+ # @return [String]
409
+ def tpm_support
410
+ data[:tpm_support]
411
+ end
412
+
413
+ # Provides information on the recovery and maintenance options of your
414
+ # instance.
415
+ # @return [Types::InstanceMaintenanceOptions]
416
+ def maintenance_options
417
+ data[:maintenance_options]
418
+ end
419
+
420
+ # The boot mode that is used to boot the instance at launch or start.
421
+ # For more information, see [Boot modes][1] in the *Amazon EC2 User
422
+ # Guide*.
423
+ #
424
+ #
425
+ #
426
+ # [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html
427
+ # @return [String]
428
+ def current_instance_boot_mode
429
+ data[:current_instance_boot_mode]
430
+ end
431
+
392
432
  # @!endgroup
393
433
 
394
434
  # @return [Client]
@@ -403,7 +443,9 @@ module Aws::EC2
403
443
  #
404
444
  # @return [self]
405
445
  def load
406
- resp = @client.describe_instances(instance_ids: [@id])
446
+ resp = Aws::Plugins::UserAgent.feature('resource') do
447
+ @client.describe_instances(instance_ids: [@id])
448
+ end
407
449
  @data = resp.reservations[0].instances[0]
408
450
  self
409
451
  end
@@ -448,7 +490,9 @@ module Aws::EC2
448
490
  options, params = separate_params_and_options(options)
449
491
  waiter = Waiters::InstanceExists.new(options)
450
492
  yield_waiter_and_warn(waiter, &block) if block_given?
451
- resp = waiter.wait(params.merge(instance_ids: [@id]))
493
+ resp = Aws::Plugins::UserAgent.feature('resource') do
494
+ waiter.wait(params.merge(instance_ids: [@id]))
495
+ end
452
496
  Instance.new({
453
497
  id: @id,
454
498
  data: resp.data.reservations[0].instances[0],
@@ -466,7 +510,9 @@ module Aws::EC2
466
510
  options, params = separate_params_and_options(options)
467
511
  waiter = Waiters::InstanceRunning.new(options)
468
512
  yield_waiter_and_warn(waiter, &block) if block_given?
469
- resp = waiter.wait(params.merge(instance_ids: [@id]))
513
+ resp = Aws::Plugins::UserAgent.feature('resource') do
514
+ waiter.wait(params.merge(instance_ids: [@id]))
515
+ end
470
516
  Instance.new({
471
517
  id: @id,
472
518
  data: resp.data.reservations[0].instances[0],
@@ -484,7 +530,9 @@ module Aws::EC2
484
530
  options, params = separate_params_and_options(options)
485
531
  waiter = Waiters::InstanceStopped.new(options)
486
532
  yield_waiter_and_warn(waiter, &block) if block_given?
487
- resp = waiter.wait(params.merge(instance_ids: [@id]))
533
+ resp = Aws::Plugins::UserAgent.feature('resource') do
534
+ waiter.wait(params.merge(instance_ids: [@id]))
535
+ end
488
536
  Instance.new({
489
537
  id: @id,
490
538
  data: resp.data.reservations[0].instances[0],
@@ -502,7 +550,9 @@ module Aws::EC2
502
550
  options, params = separate_params_and_options(options)
503
551
  waiter = Waiters::InstanceTerminated.new(options)
504
552
  yield_waiter_and_warn(waiter, &block) if block_given?
505
- resp = waiter.wait(params.merge(instance_ids: [@id]))
553
+ resp = Aws::Plugins::UserAgent.feature('resource') do
554
+ waiter.wait(params.merge(instance_ids: [@id]))
555
+ end
506
556
  Instance.new({
507
557
  id: @id,
508
558
  data: resp.data.reservations[0].instances[0],
@@ -604,7 +654,9 @@ module Aws::EC2
604
654
  :retry
605
655
  end
606
656
  end
607
- Aws::Waiters::Waiter.new(options).wait({})
657
+ Aws::Plugins::UserAgent.feature('resource') do
658
+ Aws::Waiters::Waiter.new(options).wait({})
659
+ end
608
660
  end
609
661
 
610
662
  # @!group Actions
@@ -623,14 +675,16 @@ module Aws::EC2
623
675
  # If you have the required permissions, the error response is
624
676
  # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
625
677
  # @option options [required, Array<String>] :groups
626
- # The ID of one or more of the VPC's security groups. You cannot
627
- # specify security groups from a different VPC.
678
+ # The IDs of the security groups. You cannot specify security groups
679
+ # from a different VPC.
628
680
  # @option options [required, String] :vpc_id
629
- # The ID of a ClassicLink-enabled VPC.
681
+ # The ID of the ClassicLink-enabled VPC.
630
682
  # @return [Types::AttachClassicLinkVpcResult]
631
683
  def attach_classic_link_vpc(options = {})
632
684
  options = options.merge(instance_id: @id)
633
- resp = @client.attach_classic_link_vpc(options)
685
+ resp = Aws::Plugins::UserAgent.feature('resource') do
686
+ @client.attach_classic_link_vpc(options)
687
+ end
634
688
  resp.data
635
689
  end
636
690
 
@@ -655,7 +709,9 @@ module Aws::EC2
655
709
  # @return [Types::VolumeAttachment]
656
710
  def attach_volume(options = {})
657
711
  options = options.merge(instance_id: @id)
658
- resp = @client.attach_volume(options)
712
+ resp = Aws::Plugins::UserAgent.feature('resource') do
713
+ @client.attach_volume(options)
714
+ end
659
715
  resp.data
660
716
  end
661
717
 
@@ -678,7 +734,9 @@ module Aws::EC2
678
734
  # @return [Types::GetConsoleOutputResult]
679
735
  def console_output(options = {})
680
736
  options = options.merge(instance_id: @id)
681
- resp = @client.get_console_output(options)
737
+ resp = Aws::Plugins::UserAgent.feature('resource') do
738
+ @client.get_console_output(options)
739
+ end
682
740
  resp.data
683
741
  end
684
742
 
@@ -709,7 +767,7 @@ module Aws::EC2
709
767
  # no_reboot: false,
710
768
  # tag_specifications: [
711
769
  # {
712
- # resource_type: "capacity-reservation", # accepts capacity-reservation, client-vpn-endpoint, customer-gateway, carrier-gateway, dedicated-host, dhcp-options, egress-only-internet-gateway, elastic-ip, elastic-gpu, export-image-task, export-instance-task, fleet, fpga-image, host-reservation, image, import-image-task, import-snapshot-task, instance, instance-event-window, internet-gateway, ipv4pool-ec2, ipv6pool-ec2, key-pair, launch-template, local-gateway, local-gateway-route-table, local-gateway-virtual-interface, local-gateway-virtual-interface-group, local-gateway-route-table-vpc-association, local-gateway-route-table-virtual-interface-group-association, natgateway, network-acl, network-interface, network-insights-analysis, network-insights-path, placement-group, prefix-list, replace-root-volume-task, reserved-instances, route-table, security-group, security-group-rule, snapshot, spot-fleet-request, spot-instances-request, subnet, traffic-mirror-filter, traffic-mirror-session, traffic-mirror-target, transit-gateway, transit-gateway-attachment, transit-gateway-connect-peer, transit-gateway-multicast-domain, transit-gateway-route-table, volume, vpc, vpc-endpoint, vpc-endpoint-service, vpc-peering-connection, vpn-connection, vpn-gateway, vpc-flow-log
770
+ # resource_type: "capacity-reservation", # accepts capacity-reservation, client-vpn-endpoint, customer-gateway, carrier-gateway, coip-pool, dedicated-host, dhcp-options, egress-only-internet-gateway, elastic-ip, elastic-gpu, export-image-task, export-instance-task, fleet, fpga-image, host-reservation, image, import-image-task, import-snapshot-task, instance, instance-event-window, internet-gateway, ipam, ipam-pool, ipam-scope, ipv4pool-ec2, ipv6pool-ec2, key-pair, launch-template, local-gateway, local-gateway-route-table, local-gateway-virtual-interface, local-gateway-virtual-interface-group, local-gateway-route-table-vpc-association, local-gateway-route-table-virtual-interface-group-association, natgateway, network-acl, network-interface, network-insights-analysis, network-insights-path, network-insights-access-scope, network-insights-access-scope-analysis, placement-group, prefix-list, replace-root-volume-task, reserved-instances, route-table, security-group, security-group-rule, snapshot, spot-fleet-request, spot-instances-request, subnet, subnet-cidr-reservation, traffic-mirror-filter, traffic-mirror-session, traffic-mirror-target, transit-gateway, transit-gateway-attachment, transit-gateway-connect-peer, transit-gateway-multicast-domain, transit-gateway-policy-table, transit-gateway-route-table, transit-gateway-route-table-announcement, volume, vpc, vpc-endpoint, vpc-endpoint-connection, vpc-endpoint-service, vpc-endpoint-service-permission, vpc-peering-connection, vpn-connection, vpn-gateway, vpc-flow-log, capacity-reservation-fleet, traffic-mirror-filter-rule, vpc-endpoint-connection-device-type, verified-access-instance, verified-access-group, verified-access-endpoint, verified-access-policy, verified-access-trust-provider, vpn-connection-device-type, vpc-block-public-access-exclusion, ipam-resource-discovery, ipam-resource-discovery-association, instance-connect-endpoint
713
771
  # tags: [
714
772
  # {
715
773
  # key: "String",
@@ -738,13 +796,20 @@ module Aws::EC2
738
796
  # brackets (\[\]), spaces ( ), periods (.), slashes (/), dashes (-),
739
797
  # single quotes ('), at-signs (@), or underscores(\_)
740
798
  # @option options [Boolean] :no_reboot
741
- # By default, Amazon EC2 attempts to shut down and reboot the instance
742
- # before creating the image. If the `No Reboot` option is set, Amazon
743
- # EC2 doesn't shut down the instance before creating the image. Without
744
- # a reboot, the AMI will be crash consistent (all the volumes are
745
- # snapshotted at the same time), but not application consistent (all the
746
- # operating system buffers are not flushed to disk before the snapshots
747
- # are created).
799
+ # Indicates whether or not the instance should be automatically rebooted
800
+ # before creating the image. Specify one of the following values:
801
+ #
802
+ # * `true` - The instance is not rebooted before creating the image.
803
+ # This creates crash-consistent snapshots that include only the data
804
+ # that has been written to the volumes at the time the snapshots are
805
+ # created. Buffered data and data in memory that has not yet been
806
+ # written to the volumes is not included in the snapshots.
807
+ #
808
+ # * `false` - The instance is rebooted before creating the image. This
809
+ # ensures that all buffered data and data in memory is written to the
810
+ # volumes before the snapshots are created.
811
+ #
812
+ # Default: `false`
748
813
  # @option options [Array<Types::TagSpecification>] :tag_specifications
749
814
  # The tags to apply to the AMI and snapshots on creation. You can tag
750
815
  # the AMI, the snapshots, or both.
@@ -767,7 +832,9 @@ module Aws::EC2
767
832
  # @return [Image]
768
833
  def create_image(options = {})
769
834
  options = options.merge(instance_id: @id)
770
- resp = @client.create_image(options)
835
+ resp = Aws::Plugins::UserAgent.feature('resource') do
836
+ @client.create_image(options)
837
+ end
771
838
  Image.new(
772
839
  id: resp.data.image_id,
773
840
  client: @client
@@ -799,7 +866,9 @@ module Aws::EC2
799
866
  def create_tags(options = {})
800
867
  batch = []
801
868
  options = Aws::Util.deep_merge(options, resources: [@id])
802
- resp = @client.create_tags(options)
869
+ resp = Aws::Plugins::UserAgent.feature('resource') do
870
+ @client.create_tags(options)
871
+ end
803
872
  options[:tags].each do |t|
804
873
  batch << Tag.new(
805
874
  resource_id: @id,
@@ -844,7 +913,9 @@ module Aws::EC2
844
913
  def delete_tags(options = {})
845
914
  batch = []
846
915
  options = Aws::Util.deep_merge(options, resources: [@id])
847
- resp = @client.delete_tags(options)
916
+ resp = Aws::Plugins::UserAgent.feature('resource') do
917
+ @client.delete_tags(options)
918
+ end
848
919
  options[:tags].each do |t|
849
920
  batch << Tag.new(
850
921
  resource_id: @id,
@@ -859,7 +930,7 @@ module Aws::EC2
859
930
  # @example Request syntax with placeholder values
860
931
  #
861
932
  # instance.describe_attribute({
862
- # attribute: "instanceType", # required, accepts instanceType, kernel, ramdisk, userData, disableApiTermination, instanceInitiatedShutdownBehavior, rootDeviceName, blockDeviceMapping, productCodes, sourceDestCheck, groupSet, ebsOptimized, sriovNetSupport, enaSupport, enclaveOptions
933
+ # attribute: "instanceType", # required, accepts instanceType, kernel, ramdisk, userData, disableApiTermination, instanceInitiatedShutdownBehavior, rootDeviceName, blockDeviceMapping, productCodes, sourceDestCheck, groupSet, ebsOptimized, sriovNetSupport, enaSupport, enclaveOptions, disableApiStop
863
934
  # dry_run: false,
864
935
  # })
865
936
  # @param [Hash] options ({})
@@ -875,7 +946,9 @@ module Aws::EC2
875
946
  # @return [Types::InstanceAttribute]
876
947
  def describe_attribute(options = {})
877
948
  options = options.merge(instance_id: @id)
878
- resp = @client.describe_instance_attribute(options)
949
+ resp = Aws::Plugins::UserAgent.feature('resource') do
950
+ @client.describe_instance_attribute(options)
951
+ end
879
952
  resp.data
880
953
  end
881
954
 
@@ -896,7 +969,9 @@ module Aws::EC2
896
969
  # @return [Types::DetachClassicLinkVpcResult]
897
970
  def detach_classic_link_vpc(options = {})
898
971
  options = options.merge(instance_id: @id)
899
- resp = @client.detach_classic_link_vpc(options)
972
+ resp = Aws::Plugins::UserAgent.feature('resource') do
973
+ @client.detach_classic_link_vpc(options)
974
+ end
900
975
  resp.data
901
976
  end
902
977
 
@@ -905,7 +980,7 @@ module Aws::EC2
905
980
  # instance.detach_volume({
906
981
  # device: "String",
907
982
  # force: false,
908
- # volume_id: "VolumeId", # required
983
+ # volume_id: "VolumeIdWithResolver", # required
909
984
  # dry_run: false,
910
985
  # })
911
986
  # @param [Hash] options ({})
@@ -930,7 +1005,9 @@ module Aws::EC2
930
1005
  # @return [Types::VolumeAttachment]
931
1006
  def detach_volume(options = {})
932
1007
  options = options.merge(instance_id: @id)
933
- resp = @client.detach_volume(options)
1008
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1009
+ @client.detach_volume(options)
1010
+ end
934
1011
  resp.data
935
1012
  end
936
1013
 
@@ -940,7 +1017,7 @@ module Aws::EC2
940
1017
  # source_dest_check: {
941
1018
  # value: false,
942
1019
  # },
943
- # attribute: "instanceType", # accepts instanceType, kernel, ramdisk, userData, disableApiTermination, instanceInitiatedShutdownBehavior, rootDeviceName, blockDeviceMapping, productCodes, sourceDestCheck, groupSet, ebsOptimized, sriovNetSupport, enaSupport, enclaveOptions
1020
+ # attribute: "instanceType", # accepts instanceType, kernel, ramdisk, userData, disableApiTermination, instanceInitiatedShutdownBehavior, rootDeviceName, blockDeviceMapping, productCodes, sourceDestCheck, groupSet, ebsOptimized, sriovNetSupport, enaSupport, enclaveOptions, disableApiStop
944
1021
  # block_device_mappings: [
945
1022
  # {
946
1023
  # device_name: "String",
@@ -972,6 +1049,9 @@ module Aws::EC2
972
1049
  # value: "data",
973
1050
  # },
974
1051
  # value: "String",
1052
+ # disable_api_stop: {
1053
+ # value: false,
1054
+ # },
975
1055
  # })
976
1056
  # @param [Hash] options ({})
977
1057
  # @option options [Types::AttributeBooleanValue] :source_dest_check
@@ -982,7 +1062,14 @@ module Aws::EC2
982
1062
  # You must disable source/destination checks if the instance runs
983
1063
  # services such as network address translation, routing, or firewalls.
984
1064
  # @option options [String] :attribute
985
- # The name of the attribute.
1065
+ # The name of the attribute to modify.
1066
+ #
1067
+ # You can modify the following attributes only: `disableApiTermination`
1068
+ # \| `instanceType` \| `kernel` \| `ramdisk` \|
1069
+ # `instanceInitiatedShutdownBehavior` \| `blockDeviceMapping` \|
1070
+ # `userData` \| `sourceDestCheck` \| `groupSet` \| `ebsOptimized` \|
1071
+ # `sriovNetSupport` \| `enaSupport` \| `nvmeSupport` \| `disableApiStop`
1072
+ # \| `enclaveOptions`
986
1073
  # @option options [Array<Types::InstanceBlockDeviceMappingSpecification>] :block_device_mappings
987
1074
  # Modifies the `DeleteOnTermination` attribute for volumes that are
988
1075
  # currently attached. The volume must be owned by the caller. If no
@@ -1018,10 +1105,9 @@ module Aws::EC2
1018
1105
  # This option is supported only for HVM instances. Specifying this
1019
1106
  # option with a PV instance can make it unreachable.
1020
1107
  # @option options [Array<String>] :groups
1021
- # \[EC2-VPC\] Replaces the security groups of the instance with the
1022
- # specified security groups. You must specify at least one security
1023
- # group, even if it's just the default security group for the VPC. You
1024
- # must specify the security group ID, not the security group name.
1108
+ # Replaces the security groups of the instance with the specified
1109
+ # security groups. You must specify the ID of at least one security
1110
+ # group, even if it's just the default security group for the VPC.
1025
1111
  # @option options [Types::AttributeValue] :instance_initiated_shutdown_behavior
1026
1112
  # Specifies whether an instance stops or terminates when you initiate
1027
1113
  # shutdown from the instance (using the operating system command for
@@ -1069,10 +1155,21 @@ module Aws::EC2
1069
1155
  # A new value for the attribute. Use only with the `kernel`, `ramdisk`,
1070
1156
  # `userData`, `disableApiTermination`, or
1071
1157
  # `instanceInitiatedShutdownBehavior` attribute.
1158
+ # @option options [Types::AttributeBooleanValue] :disable_api_stop
1159
+ # Indicates whether an instance is enabled for stop protection. For more
1160
+ # information, see [Stop Protection][1].
1161
+ #
1162
+ #
1163
+ #
1164
+ #
1165
+ #
1166
+ # [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection
1072
1167
  # @return [EmptyStructure]
1073
1168
  def modify_attribute(options = {})
1074
1169
  options = options.merge(instance_id: @id)
1075
- resp = @client.modify_instance_attribute(options)
1170
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1171
+ @client.modify_instance_attribute(options)
1172
+ end
1076
1173
  resp.data
1077
1174
  end
1078
1175
 
@@ -1090,7 +1187,9 @@ module Aws::EC2
1090
1187
  # @return [Types::MonitorInstancesResult]
1091
1188
  def monitor(options = {})
1092
1189
  options = Aws::Util.deep_merge(options, instance_ids: [@id])
1093
- resp = @client.monitor_instances(options)
1190
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1191
+ @client.monitor_instances(options)
1192
+ end
1094
1193
  resp.data
1095
1194
  end
1096
1195
 
@@ -1108,7 +1207,9 @@ module Aws::EC2
1108
1207
  # @return [Types::GetPasswordDataResult]
1109
1208
  def password_data(options = {})
1110
1209
  options = options.merge(instance_id: @id)
1111
- resp = @client.get_password_data(options)
1210
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1211
+ @client.get_password_data(options)
1212
+ end
1112
1213
  resp.data
1113
1214
  end
1114
1215
 
@@ -1126,7 +1227,9 @@ module Aws::EC2
1126
1227
  # @return [EmptyStructure]
1127
1228
  def reboot(options = {})
1128
1229
  options = Aws::Util.deep_merge(options, instance_ids: [@id])
1129
- resp = @client.reboot_instances(options)
1230
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1231
+ @client.reboot_instances(options)
1232
+ end
1130
1233
  resp.data
1131
1234
  end
1132
1235
 
@@ -1153,30 +1256,30 @@ module Aws::EC2
1153
1256
  # @option options [required, Array<String>] :reason_codes
1154
1257
  # The reason codes that describe the health state of your instance.
1155
1258
  #
1156
- # * `instance-stuck-in-state`\: My instance is stuck in a state.
1259
+ # * `instance-stuck-in-state`: My instance is stuck in a state.
1157
1260
  #
1158
- # * `unresponsive`\: My instance is unresponsive.
1261
+ # * `unresponsive`: My instance is unresponsive.
1159
1262
  #
1160
- # * `not-accepting-credentials`\: My instance is not accepting my
1263
+ # * `not-accepting-credentials`: My instance is not accepting my
1161
1264
  # credentials.
1162
1265
  #
1163
- # * `password-not-available`\: A password is not available for my
1266
+ # * `password-not-available`: A password is not available for my
1164
1267
  # instance.
1165
1268
  #
1166
- # * `performance-network`\: My instance is experiencing performance
1269
+ # * `performance-network`: My instance is experiencing performance
1167
1270
  # problems that I believe are network related.
1168
1271
  #
1169
- # * `performance-instance-store`\: My instance is experiencing
1272
+ # * `performance-instance-store`: My instance is experiencing
1170
1273
  # performance problems that I believe are related to the instance
1171
1274
  # stores.
1172
1275
  #
1173
- # * `performance-ebs-volume`\: My instance is experiencing performance
1276
+ # * `performance-ebs-volume`: My instance is experiencing performance
1174
1277
  # problems that I believe are related to an EBS volume.
1175
1278
  #
1176
- # * `performance-other`\: My instance is experiencing performance
1279
+ # * `performance-other`: My instance is experiencing performance
1177
1280
  # problems.
1178
1281
  #
1179
- # * `other`\: \[explain using the description parameter\]
1282
+ # * `other`: \[explain using the description parameter\]
1180
1283
  # @option options [Time,DateTime,Date,Integer,String] :start_time
1181
1284
  # The time at which the reported instance health state began.
1182
1285
  # @option options [required, String] :status
@@ -1184,14 +1287,16 @@ module Aws::EC2
1184
1287
  # @return [EmptyStructure]
1185
1288
  def report_status(options = {})
1186
1289
  options = Aws::Util.deep_merge(options, instances: [@id])
1187
- resp = @client.report_instance_status(options)
1290
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1291
+ @client.report_instance_status(options)
1292
+ end
1188
1293
  resp.data
1189
1294
  end
1190
1295
 
1191
1296
  # @example Request syntax with placeholder values
1192
1297
  #
1193
1298
  # instance.reset_attribute({
1194
- # attribute: "instanceType", # required, accepts instanceType, kernel, ramdisk, userData, disableApiTermination, instanceInitiatedShutdownBehavior, rootDeviceName, blockDeviceMapping, productCodes, sourceDestCheck, groupSet, ebsOptimized, sriovNetSupport, enaSupport, enclaveOptions
1299
+ # attribute: "instanceType", # required, accepts instanceType, kernel, ramdisk, userData, disableApiTermination, instanceInitiatedShutdownBehavior, rootDeviceName, blockDeviceMapping, productCodes, sourceDestCheck, groupSet, ebsOptimized, sriovNetSupport, enaSupport, enclaveOptions, disableApiStop
1195
1300
  # dry_run: false,
1196
1301
  # })
1197
1302
  # @param [Hash] options ({})
@@ -1199,8 +1304,7 @@ module Aws::EC2
1199
1304
  # The attribute to reset.
1200
1305
  #
1201
1306
  # You can only reset the following attributes: `kernel` \| `ramdisk` \|
1202
- # `sourceDestCheck`. To change an instance attribute, use
1203
- # ModifyInstanceAttribute.
1307
+ # `sourceDestCheck`.
1204
1308
  # @option options [Boolean] :dry_run
1205
1309
  # Checks whether you have the required permissions for the action,
1206
1310
  # without actually making the request, and provides an error response.
@@ -1209,7 +1313,9 @@ module Aws::EC2
1209
1313
  # @return [EmptyStructure]
1210
1314
  def reset_attribute(options = {})
1211
1315
  options = options.merge(instance_id: @id)
1212
- resp = @client.reset_instance_attribute(options)
1316
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1317
+ @client.reset_instance_attribute(options)
1318
+ end
1213
1319
  resp.data
1214
1320
  end
1215
1321
 
@@ -1230,7 +1336,9 @@ module Aws::EC2
1230
1336
  instance_id: @id,
1231
1337
  attribute: "kernel"
1232
1338
  )
1233
- resp = @client.reset_instance_attribute(options)
1339
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1340
+ @client.reset_instance_attribute(options)
1341
+ end
1234
1342
  resp.data
1235
1343
  end
1236
1344
 
@@ -1251,7 +1359,9 @@ module Aws::EC2
1251
1359
  instance_id: @id,
1252
1360
  attribute: "ramdisk"
1253
1361
  )
1254
- resp = @client.reset_instance_attribute(options)
1362
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1363
+ @client.reset_instance_attribute(options)
1364
+ end
1255
1365
  resp.data
1256
1366
  end
1257
1367
 
@@ -1272,7 +1382,9 @@ module Aws::EC2
1272
1382
  instance_id: @id,
1273
1383
  attribute: "sourceDestCheck"
1274
1384
  )
1275
- resp = @client.reset_instance_attribute(options)
1385
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1386
+ @client.reset_instance_attribute(options)
1387
+ end
1276
1388
  resp.data
1277
1389
  end
1278
1390
 
@@ -1293,7 +1405,9 @@ module Aws::EC2
1293
1405
  # @return [Types::StartInstancesResult]
1294
1406
  def start(options = {})
1295
1407
  options = Aws::Util.deep_merge(options, instance_ids: [@id])
1296
- resp = @client.start_instances(options)
1408
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1409
+ @client.start_instances(options)
1410
+ end
1297
1411
  resp.data
1298
1412
  end
1299
1413
 
@@ -1331,7 +1445,9 @@ module Aws::EC2
1331
1445
  # @return [Types::StopInstancesResult]
1332
1446
  def stop(options = {})
1333
1447
  options = Aws::Util.deep_merge(options, instance_ids: [@id])
1334
- resp = @client.stop_instances(options)
1448
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1449
+ @client.stop_instances(options)
1450
+ end
1335
1451
  resp.data
1336
1452
  end
1337
1453
 
@@ -1349,7 +1465,9 @@ module Aws::EC2
1349
1465
  # @return [Types::TerminateInstancesResult]
1350
1466
  def terminate(options = {})
1351
1467
  options = Aws::Util.deep_merge(options, instance_ids: [@id])
1352
- resp = @client.terminate_instances(options)
1468
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1469
+ @client.terminate_instances(options)
1470
+ end
1353
1471
  resp.data
1354
1472
  end
1355
1473
 
@@ -1367,7 +1485,9 @@ module Aws::EC2
1367
1485
  # @return [Types::UnmonitorInstancesResult]
1368
1486
  def unmonitor(options = {})
1369
1487
  options = Aws::Util.deep_merge(options, instance_ids: [@id])
1370
- resp = @client.unmonitor_instances(options)
1488
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1489
+ @client.unmonitor_instances(options)
1490
+ end
1371
1491
  resp.data
1372
1492
  end
1373
1493
 
@@ -1499,7 +1619,7 @@ module Aws::EC2
1499
1619
  # * `status` - The state of the volume (`creating` \| `available` \|
1500
1620
  # `in-use` \| `deleting` \| `deleted` \| `error`).
1501
1621
  #
1502
- # * `tag`\:&lt;key&gt; - The key/value combination of a tag assigned to
1622
+ # * `tag`:&lt;key&gt; - The key/value combination of a tag assigned to
1503
1623
  # the resource. Use the tag key in the filter name and the tag value
1504
1624
  # as the filter value. For example, to find all resources that have a
1505
1625
  # tag with the key `Owner` and the value `TeamA`, specify `tag:Owner`
@@ -1527,7 +1647,9 @@ module Aws::EC2
1527
1647
  name: "attachment.instance-id",
1528
1648
  values: [@id]
1529
1649
  }])
1530
- resp = @client.describe_volumes(options)
1650
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1651
+ @client.describe_volumes(options)
1652
+ end
1531
1653
  resp.each_page do |page|
1532
1654
  batch = []
1533
1655
  page.data.volumes.each do |v|
@@ -1572,12 +1694,9 @@ module Aws::EC2
1572
1694
  # @option options [Array<Types::Filter>] :filters
1573
1695
  # One or more filters. Filter names and values are case-sensitive.
1574
1696
  #
1575
- # * `allocation-id` - \[EC2-VPC\] The allocation ID for the address.
1697
+ # * `allocation-id` - The allocation ID for the address.
1576
1698
  #
1577
- # * `association-id` - \[EC2-VPC\] The association ID for the address.
1578
- #
1579
- # * `domain` - Indicates whether the address is for use in EC2-Classic
1580
- # (`standard`) or in a VPC (`vpc`).
1699
+ # * `association-id` - The association ID for the address.
1581
1700
  #
1582
1701
  # * `instance-id` - The ID of the instance the address is associated
1583
1702
  # with, if any.
@@ -1586,18 +1705,18 @@ module Aws::EC2
1586
1705
  # Zones, or Wavelength Zones from where Amazon Web Services advertises
1587
1706
  # IP addresses.
1588
1707
  #
1589
- # * `network-interface-id` - \[EC2-VPC\] The ID of the network interface
1590
- # that the address is associated with, if any.
1708
+ # * `network-interface-id` - The ID of the network interface that the
1709
+ # address is associated with, if any.
1591
1710
  #
1592
1711
  # * `network-interface-owner-id` - The Amazon Web Services account ID of
1593
1712
  # the owner.
1594
1713
  #
1595
- # * `private-ip-address` - \[EC2-VPC\] The private IP address associated
1596
- # with the Elastic IP address.
1714
+ # * `private-ip-address` - The private IP address associated with the
1715
+ # Elastic IP address.
1597
1716
  #
1598
1717
  # * `public-ip` - The Elastic IP address, or the carrier IP address.
1599
1718
  #
1600
- # * `tag`\:&lt;key&gt; - The key/value combination of a tag assigned to
1719
+ # * `tag`:&lt;key&gt; - The key/value combination of a tag assigned to
1601
1720
  # the resource. Use the tag key in the filter name and the tag value
1602
1721
  # as the filter value. For example, to find all resources that have a
1603
1722
  # tag with the key `Owner` and the value `TeamA`, specify `tag:Owner`
@@ -1611,7 +1730,7 @@ module Aws::EC2
1611
1730
  #
1612
1731
  # Default: Describes all your Elastic IP addresses.
1613
1732
  # @option options [Array<String>] :allocation_ids
1614
- # \[EC2-VPC\] Information about the allocation IDs.
1733
+ # Information about the allocation IDs.
1615
1734
  # @option options [Boolean] :dry_run
1616
1735
  # Checks whether you have the required permissions for the action,
1617
1736
  # without actually making the request, and provides an error response.
@@ -1625,7 +1744,9 @@ module Aws::EC2
1625
1744
  name: "instance-id",
1626
1745
  values: [@id]
1627
1746
  }])
1628
- resp = @client.describe_addresses(options)
1747
+ resp = Aws::Plugins::UserAgent.feature('resource') do
1748
+ @client.describe_addresses(options)
1749
+ end
1629
1750
  resp.data.addresses.each do |a|
1630
1751
  batch << VpcAddress.new(
1631
1752
  allocation_id: a.allocation_id,
@@ -1718,7 +1839,9 @@ module Aws::EC2
1718
1839
  batch.each do |item|
1719
1840
  params[:resources] << item.id
1720
1841
  end
1721
- batch[0].client.create_tags(params)
1842
+ Aws::Plugins::UserAgent.feature('resource') do
1843
+ batch[0].client.create_tags(params)
1844
+ end
1722
1845
  end
1723
1846
  nil
1724
1847
  end
@@ -1760,7 +1883,9 @@ module Aws::EC2
1760
1883
  batch.each do |item|
1761
1884
  params[:resources] << item.id
1762
1885
  end
1763
- batch[0].client.delete_tags(params)
1886
+ Aws::Plugins::UserAgent.feature('resource') do
1887
+ batch[0].client.delete_tags(params)
1888
+ end
1764
1889
  end
1765
1890
  nil
1766
1891
  end
@@ -1784,7 +1909,9 @@ module Aws::EC2
1784
1909
  batch.each do |item|
1785
1910
  params[:instance_ids] << item.id
1786
1911
  end
1787
- batch[0].client.monitor_instances(params)
1912
+ Aws::Plugins::UserAgent.feature('resource') do
1913
+ batch[0].client.monitor_instances(params)
1914
+ end
1788
1915
  end
1789
1916
  nil
1790
1917
  end
@@ -1808,7 +1935,9 @@ module Aws::EC2
1808
1935
  batch.each do |item|
1809
1936
  params[:instance_ids] << item.id
1810
1937
  end
1811
- batch[0].client.reboot_instances(params)
1938
+ Aws::Plugins::UserAgent.feature('resource') do
1939
+ batch[0].client.reboot_instances(params)
1940
+ end
1812
1941
  end
1813
1942
  nil
1814
1943
  end
@@ -1835,7 +1964,9 @@ module Aws::EC2
1835
1964
  batch.each do |item|
1836
1965
  params[:instance_ids] << item.id
1837
1966
  end
1838
- batch[0].client.start_instances(params)
1967
+ Aws::Plugins::UserAgent.feature('resource') do
1968
+ batch[0].client.start_instances(params)
1969
+ end
1839
1970
  end
1840
1971
  nil
1841
1972
  end
@@ -1879,7 +2010,9 @@ module Aws::EC2
1879
2010
  batch.each do |item|
1880
2011
  params[:instance_ids] << item.id
1881
2012
  end
1882
- batch[0].client.stop_instances(params)
2013
+ Aws::Plugins::UserAgent.feature('resource') do
2014
+ batch[0].client.stop_instances(params)
2015
+ end
1883
2016
  end
1884
2017
  nil
1885
2018
  end
@@ -1903,7 +2036,9 @@ module Aws::EC2
1903
2036
  batch.each do |item|
1904
2037
  params[:instance_ids] << item.id
1905
2038
  end
1906
- batch[0].client.terminate_instances(params)
2039
+ Aws::Plugins::UserAgent.feature('resource') do
2040
+ batch[0].client.terminate_instances(params)
2041
+ end
1907
2042
  end
1908
2043
  nil
1909
2044
  end
@@ -1927,7 +2062,9 @@ module Aws::EC2
1927
2062
  batch.each do |item|
1928
2063
  params[:instance_ids] << item.id
1929
2064
  end
1930
- batch[0].client.unmonitor_instances(params)
2065
+ Aws::Plugins::UserAgent.feature('resource') do
2066
+ batch[0].client.unmonitor_instances(params)
2067
+ end
1931
2068
  end
1932
2069
  nil
1933
2070
  end