aws-sdk-ec2 1.402.0 → 1.547.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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +735 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-sdk-ec2/classic_address.rb +32 -20
  5. data/lib/aws-sdk-ec2/client.rb +14212 -4429
  6. data/lib/aws-sdk-ec2/client_api.rb +4004 -515
  7. data/lib/aws-sdk-ec2/customizations/instance.rb +18 -1
  8. data/lib/aws-sdk-ec2/customizations/resource.rb +46 -3
  9. data/lib/aws-sdk-ec2/customizations/tag.rb +13 -0
  10. data/lib/aws-sdk-ec2/customizations.rb +0 -22
  11. data/lib/aws-sdk-ec2/dhcp_options.rb +12 -12
  12. data/lib/aws-sdk-ec2/endpoint_parameters.rb +9 -6
  13. data/lib/aws-sdk-ec2/endpoint_provider.rb +16 -20
  14. data/lib/aws-sdk-ec2/endpoints.rb +2 -8314
  15. data/lib/aws-sdk-ec2/image.rb +207 -98
  16. data/lib/aws-sdk-ec2/instance.rb +514 -348
  17. data/lib/aws-sdk-ec2/internet_gateway.rb +7 -7
  18. data/lib/aws-sdk-ec2/key_pair.rb +14 -14
  19. data/lib/aws-sdk-ec2/key_pair_info.rb +30 -30
  20. data/lib/aws-sdk-ec2/nat_gateway.rb +7 -8
  21. data/lib/aws-sdk-ec2/network_acl.rb +70 -70
  22. data/lib/aws-sdk-ec2/network_interface.rb +150 -78
  23. data/lib/aws-sdk-ec2/network_interface_association.rb +3 -3
  24. data/lib/aws-sdk-ec2/placement_group.rb +123 -42
  25. data/lib/aws-sdk-ec2/plugins/endpoints.rb +23 -1202
  26. data/lib/aws-sdk-ec2/resource.rb +1118 -864
  27. data/lib/aws-sdk-ec2/route.rb +50 -34
  28. data/lib/aws-sdk-ec2/route_table.rb +47 -44
  29. data/lib/aws-sdk-ec2/route_table_association.rb +3 -3
  30. data/lib/aws-sdk-ec2/security_group.rb +212 -201
  31. data/lib/aws-sdk-ec2/snapshot.rb +169 -105
  32. data/lib/aws-sdk-ec2/subnet.rb +534 -406
  33. data/lib/aws-sdk-ec2/tag.rb +7 -4
  34. data/lib/aws-sdk-ec2/types.rb +18252 -4766
  35. data/lib/aws-sdk-ec2/volume.rb +160 -116
  36. data/lib/aws-sdk-ec2/vpc.rb +387 -262
  37. data/lib/aws-sdk-ec2/vpc_address.rb +37 -25
  38. data/lib/aws-sdk-ec2/vpc_peering_connection.rb +6 -6
  39. data/lib/aws-sdk-ec2/waiters.rb +146 -38
  40. data/lib/aws-sdk-ec2.rb +40 -36
  41. data/sig/classic_address.rbs +108 -0
  42. data/sig/client.rbs +14833 -0
  43. data/sig/dhcp_options.rbs +84 -0
  44. data/sig/errors.rbs +16 -0
  45. data/sig/image.rbs +232 -0
  46. data/sig/instance.rbs +576 -0
  47. data/sig/internet_gateway.rbs +91 -0
  48. data/sig/key_pair.rbs +54 -0
  49. data/sig/key_pair_info.rbs +63 -0
  50. data/sig/nat_gateway.rbs +107 -0
  51. data/sig/network_acl.rbs +144 -0
  52. data/sig/network_interface.rbs +249 -0
  53. data/sig/network_interface_association.rbs +62 -0
  54. data/sig/placement_group.rbs +78 -0
  55. data/sig/resource.rbs +1049 -0
  56. data/sig/route.rbs +120 -0
  57. data/sig/route_table.rbs +118 -0
  58. data/sig/route_table_association.rbs +69 -0
  59. data/sig/security_group.rbs +311 -0
  60. data/sig/snapshot.rbs +204 -0
  61. data/sig/subnet.rbs +442 -0
  62. data/sig/tag.rbs +63 -0
  63. data/sig/types.rbs +17078 -0
  64. data/sig/volume.rbs +213 -0
  65. data/sig/vpc.rbs +404 -0
  66. data/sig/vpc_address.rbs +104 -0
  67. data/sig/vpc_peering_connection.rbs +84 -0
  68. data/sig/waiters.rbs +700 -0
  69. metadata +45 -19
@@ -35,58 +35,6 @@ module Aws::EC2
35
35
  end
36
36
  alias :image_id :id
37
37
 
38
- # The architecture of the image.
39
- # @return [String]
40
- def architecture
41
- data[:architecture]
42
- end
43
-
44
- # The date and time the image was created.
45
- # @return [String]
46
- def creation_date
47
- data[:creation_date]
48
- end
49
-
50
- # The location of the AMI.
51
- # @return [String]
52
- def image_location
53
- data[:image_location]
54
- end
55
-
56
- # The type of image.
57
- # @return [String]
58
- def image_type
59
- data[:image_type]
60
- end
61
-
62
- # Indicates whether the image has public launch permissions. The value
63
- # is `true` if this image has public launch permissions or `false` if it
64
- # has only implicit and explicit launch permissions.
65
- # @return [Boolean]
66
- def public
67
- data[:public]
68
- end
69
-
70
- # The kernel associated with the image, if any. Only applicable for
71
- # machine images.
72
- # @return [String]
73
- def kernel_id
74
- data[:kernel_id]
75
- end
76
-
77
- # The ID of the Amazon Web Services account that owns the image.
78
- # @return [String]
79
- def owner_id
80
- data[:owner_id]
81
- end
82
-
83
- # This value is set to `windows` for Windows AMIs; otherwise, it is
84
- # blank.
85
- # @return [String]
86
- def platform
87
- data[:platform]
88
- end
89
-
90
38
  # The platform details associated with the billing code of the AMI. For
91
39
  # more information, see [Understand AMI billing information][1] in the
92
40
  # *Amazon EC2 User Guide*.
@@ -119,26 +67,6 @@ module Aws::EC2
119
67
  data[:usage_operation]
120
68
  end
121
69
 
122
- # Any product codes associated with the AMI.
123
- # @return [Array<Types::ProductCode>]
124
- def product_codes
125
- data[:product_codes]
126
- end
127
-
128
- # The RAM disk associated with the image, if any. Only applicable for
129
- # machine images.
130
- # @return [String]
131
- def ramdisk_id
132
- data[:ramdisk_id]
133
- end
134
-
135
- # The current state of the AMI. If the state is `available`, the image
136
- # is successfully registered and can be used to launch an instance.
137
- # @return [String]
138
- def state
139
- data[:state]
140
- end
141
-
142
70
  # Any block device mapping entries.
143
71
  # @return [Array<Types::BlockDeviceMapping>]
144
72
  def block_device_mappings
@@ -157,14 +85,14 @@ module Aws::EC2
157
85
  data[:ena_support]
158
86
  end
159
87
 
160
- # The hypervisor type of the image.
88
+ # The hypervisor type of the image. Only `xen` is supported. `ovm` is
89
+ # not supported.
161
90
  # @return [String]
162
91
  def hypervisor
163
92
  data[:hypervisor]
164
93
  end
165
94
 
166
- # The Amazon Web Services account alias (for example, `amazon`, `self`)
167
- # or the Amazon Web Services account ID of the AMI owner.
95
+ # The owner alias (`amazon` \| `aws-backup-vault` \| `aws-marketplace`).
168
96
  # @return [String]
169
97
  def image_owner_alias
170
98
  data[:image_owner_alias]
@@ -214,8 +142,9 @@ module Aws::EC2
214
142
  data[:virtualization_type]
215
143
  end
216
144
 
217
- # The boot mode of the image. For more information, see [Boot modes][1]
218
- # in the *Amazon EC2 User Guide*.
145
+ # The boot mode of the image. For more information, see [Instance launch
146
+ # behavior with Amazon EC2 boot modes][1] in the *Amazon EC2 User
147
+ # Guide*.
219
148
  #
220
149
  #
221
150
  #
@@ -260,6 +189,175 @@ module Aws::EC2
260
189
  data[:imds_support]
261
190
  end
262
191
 
192
+ # The ID of the instance that the AMI was created from if the AMI was
193
+ # created using [CreateImage][1]. This field only appears if the AMI was
194
+ # created using CreateImage.
195
+ #
196
+ #
197
+ #
198
+ # [1]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html
199
+ # @return [String]
200
+ def source_instance_id
201
+ data[:source_instance_id]
202
+ end
203
+
204
+ # Indicates whether deregistration protection is enabled for the AMI.
205
+ # @return [String]
206
+ def deregistration_protection
207
+ data[:deregistration_protection]
208
+ end
209
+
210
+ # The date and time, in [ISO 8601 date-time format][1], when the AMI was
211
+ # last used to launch an EC2 instance. When the AMI is used to launch an
212
+ # instance, there is a 24-hour delay before that usage is reported.
213
+ #
214
+ # <note markdown="1"> `lastLaunchedTime` data is available starting April 2017.
215
+ #
216
+ # </note>
217
+ #
218
+ #
219
+ #
220
+ # [1]: http://www.iso.org/iso/iso8601
221
+ # @return [String]
222
+ def last_launched_time
223
+ data[:last_launched_time]
224
+ end
225
+
226
+ # If `true`, the AMI satisfies the criteria for Allowed AMIs and can be
227
+ # discovered and used in the account. If `false` and Allowed AMIs is set
228
+ # to `enabled`, the AMI can't be discovered or used in the account. If
229
+ # `false` and Allowed AMIs is set to `audit-mode`, the AMI can be
230
+ # discovered and used in the account.
231
+ #
232
+ # For more information, see [Control the discovery and use of AMIs in
233
+ # Amazon EC2 with Allowed AMIs][1] in *Amazon EC2 User Guide*.
234
+ #
235
+ #
236
+ #
237
+ # [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html
238
+ # @return [Boolean]
239
+ def image_allowed
240
+ data[:image_allowed]
241
+ end
242
+
243
+ # The ID of the source AMI from which the AMI was created.
244
+ #
245
+ # The ID only appears if the AMI was created using CreateImage,
246
+ # CopyImage, or CreateRestoreImageTask. The ID does not appear if the
247
+ # AMI was created using any other API. For some older AMIs, the ID might
248
+ # not be available. For more information, see [Identify the source AMI
249
+ # used to create a new Amazon EC2 AMI][1] in the *Amazon EC2 User
250
+ # Guide*.
251
+ #
252
+ #
253
+ #
254
+ # [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/identify-source-ami-used-to-create-new-ami.html
255
+ # @return [String]
256
+ def source_image_id
257
+ data[:source_image_id]
258
+ end
259
+
260
+ # The Region of the source AMI.
261
+ #
262
+ # The Region only appears if the AMI was created using CreateImage,
263
+ # CopyImage, or CreateRestoreImageTask. The Region does not appear if
264
+ # the AMI was created using any other API. For some older AMIs, the
265
+ # Region might not be available. For more information, see [Identify the
266
+ # source AMI used to create a new Amazon EC2 AMI][1] in the *Amazon EC2
267
+ # User Guide*.
268
+ #
269
+ #
270
+ #
271
+ # [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/identify-source-ami-used-to-create-new-ami.html
272
+ # @return [String]
273
+ def source_image_region
274
+ data[:source_image_region]
275
+ end
276
+
277
+ # Indicates whether the image is eligible for Amazon Web Services Free
278
+ # Tier.
279
+ #
280
+ # * If `true`, the AMI is eligible for Free Tier and can be used to
281
+ # launch instances under the Free Tier limits.
282
+ #
283
+ # * If `false`, the AMI is not eligible for Free Tier.
284
+ # @return [Boolean]
285
+ def free_tier_eligible
286
+ data[:free_tier_eligible]
287
+ end
288
+
289
+ # The location of the AMI.
290
+ # @return [String]
291
+ def image_location
292
+ data[:image_location]
293
+ end
294
+
295
+ # The current state of the AMI. If the state is `available`, the image
296
+ # is successfully registered and can be used to launch an instance.
297
+ # @return [String]
298
+ def state
299
+ data[:state]
300
+ end
301
+
302
+ # The ID of the Amazon Web Services account that owns the image.
303
+ # @return [String]
304
+ def owner_id
305
+ data[:owner_id]
306
+ end
307
+
308
+ # The date and time the image was created.
309
+ # @return [String]
310
+ def creation_date
311
+ data[:creation_date]
312
+ end
313
+
314
+ # Indicates whether the image has public launch permissions. The value
315
+ # is `true` if this image has public launch permissions or `false` if it
316
+ # has only implicit and explicit launch permissions.
317
+ # @return [Boolean]
318
+ def public
319
+ data[:public]
320
+ end
321
+
322
+ # Any product codes associated with the AMI.
323
+ # @return [Array<Types::ProductCode>]
324
+ def product_codes
325
+ data[:product_codes]
326
+ end
327
+
328
+ # The architecture of the image.
329
+ # @return [String]
330
+ def architecture
331
+ data[:architecture]
332
+ end
333
+
334
+ # The type of image.
335
+ # @return [String]
336
+ def image_type
337
+ data[:image_type]
338
+ end
339
+
340
+ # The kernel associated with the image, if any. Only applicable for
341
+ # machine images.
342
+ # @return [String]
343
+ def kernel_id
344
+ data[:kernel_id]
345
+ end
346
+
347
+ # The RAM disk associated with the image, if any. Only applicable for
348
+ # machine images.
349
+ # @return [String]
350
+ def ramdisk_id
351
+ data[:ramdisk_id]
352
+ end
353
+
354
+ # This value is set to `windows` for Windows AMIs; otherwise, it is
355
+ # blank.
356
+ # @return [String]
357
+ def platform
358
+ data[:platform]
359
+ end
360
+
263
361
  # @!endgroup
264
362
 
265
363
  # @return [Client]
@@ -274,7 +372,7 @@ module Aws::EC2
274
372
  #
275
373
  # @return [self]
276
374
  def load
277
- resp = Aws::Plugins::UserAgent.feature('resource') do
375
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
278
376
  @client.describe_images(image_ids: [@id])
279
377
  end
280
378
  @data = resp.images[0]
@@ -321,7 +419,7 @@ module Aws::EC2
321
419
  options, params = separate_params_and_options(options)
322
420
  waiter = Waiters::ImageExists.new(options)
323
421
  yield_waiter_and_warn(waiter, &block) if block_given?
324
- resp = Aws::Plugins::UserAgent.feature('resource') do
422
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
325
423
  waiter.wait(params.merge(image_ids: [@id]))
326
424
  end
327
425
  Image.new({
@@ -425,7 +523,7 @@ module Aws::EC2
425
523
  :retry
426
524
  end
427
525
  end
428
- Aws::Plugins::UserAgent.feature('resource') do
526
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
429
527
  Aws::Waiters::Waiter.new(options).wait({})
430
528
  end
431
529
  end
@@ -457,7 +555,7 @@ module Aws::EC2
457
555
  def create_tags(options = {})
458
556
  batch = []
459
557
  options = Aws::Util.deep_merge(options, resources: [@id])
460
- resp = Aws::Plugins::UserAgent.feature('resource') do
558
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
461
559
  @client.create_tags(options)
462
560
  end
463
561
  options[:tags].each do |t|
@@ -504,7 +602,7 @@ module Aws::EC2
504
602
  def delete_tags(options = {})
505
603
  batch = []
506
604
  options = Aws::Util.deep_merge(options, resources: [@id])
507
- resp = Aws::Plugins::UserAgent.feature('resource') do
605
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
508
606
  @client.delete_tags(options)
509
607
  end
510
608
  options[:tags].each do |t|
@@ -521,18 +619,29 @@ module Aws::EC2
521
619
  # @example Request syntax with placeholder values
522
620
  #
523
621
  # image.deregister({
622
+ # delete_associated_snapshots: false,
524
623
  # dry_run: false,
525
624
  # })
526
625
  # @param [Hash] options ({})
626
+ # @option options [Boolean] :delete_associated_snapshots
627
+ # Specifies whether to delete the snapshots associated with the AMI
628
+ # during deregistration.
629
+ #
630
+ # <note markdown="1"> If a snapshot is associated with multiple AMIs, it is not deleted,
631
+ # regardless of this setting.
632
+ #
633
+ # </note>
634
+ #
635
+ # Default: The snapshots are not deleted.
527
636
  # @option options [Boolean] :dry_run
528
637
  # Checks whether you have the required permissions for the action,
529
638
  # without actually making the request, and provides an error response.
530
639
  # If you have the required permissions, the error response is
531
640
  # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
532
- # @return [EmptyStructure]
641
+ # @return [Types::DeregisterImageResult]
533
642
  def deregister(options = {})
534
643
  options = options.merge(image_id: @id)
535
- resp = Aws::Plugins::UserAgent.feature('resource') do
644
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
536
645
  @client.deregister_image(options)
537
646
  end
538
647
  resp.data
@@ -541,7 +650,7 @@ module Aws::EC2
541
650
  # @example Request syntax with placeholder values
542
651
  #
543
652
  # image.describe_attribute({
544
- # attribute: "description", # required, accepts description, kernel, ramdisk, launchPermission, productCodes, blockDeviceMapping, sriovNetSupport, bootMode, tpmSupport, uefiData, lastLaunchedTime, imdsSupport
653
+ # attribute: "description", # required, accepts description, kernel, ramdisk, launchPermission, productCodes, blockDeviceMapping, sriovNetSupport, bootMode, tpmSupport, uefiData, lastLaunchedTime, imdsSupport, deregistrationProtection
545
654
  # dry_run: false,
546
655
  # })
547
656
  # @param [Hash] options ({})
@@ -560,7 +669,7 @@ module Aws::EC2
560
669
  # @return [Types::ImageAttribute]
561
670
  def describe_attribute(options = {})
562
671
  options = options.merge(image_id: @id)
563
- resp = Aws::Plugins::UserAgent.feature('resource') do
672
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
564
673
  @client.describe_image_attribute(options)
565
674
  end
566
675
  resp.data
@@ -574,18 +683,18 @@ module Aws::EC2
574
683
  # launch_permission: {
575
684
  # add: [
576
685
  # {
577
- # group: "all", # accepts all
578
- # user_id: "String",
579
686
  # organization_arn: "String",
580
687
  # organizational_unit_arn: "String",
688
+ # user_id: "String",
689
+ # group: "all", # accepts all
581
690
  # },
582
691
  # ],
583
692
  # remove: [
584
693
  # {
585
- # group: "all", # accepts all
586
- # user_id: "String",
587
694
  # organization_arn: "String",
588
695
  # organizational_unit_arn: "String",
696
+ # user_id: "String",
697
+ # group: "all", # accepts all
589
698
  # },
590
699
  # ],
591
700
  # },
@@ -594,10 +703,10 @@ module Aws::EC2
594
703
  # user_groups: ["String"],
595
704
  # user_ids: ["String"],
596
705
  # value: "String",
597
- # dry_run: false,
598
706
  # organization_arns: ["String"],
599
707
  # organizational_unit_arns: ["String"],
600
708
  # imds_support: "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
709
+ # dry_run: false,
601
710
  # })
602
711
  # @param [Hash] options ({})
603
712
  # @option options [String] :attribute
@@ -622,11 +731,6 @@ module Aws::EC2
622
731
  # @option options [String] :value
623
732
  # The value of the attribute being modified. This parameter can be used
624
733
  # only when the `Attribute` parameter is `description` or `imdsSupport`.
625
- # @option options [Boolean] :dry_run
626
- # Checks whether you have the required permissions for the action,
627
- # without actually making the request, and provides an error response.
628
- # If you have the required permissions, the error response is
629
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
630
734
  # @option options [Array<String>] :organization_arns
631
735
  # The Amazon Resource Name (ARN) of an organization. This parameter can
632
736
  # be used only when the `Attribute` parameter is `launchPermission`.
@@ -649,10 +753,15 @@ module Aws::EC2
649
753
  #
650
754
  #
651
755
  # [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration
756
+ # @option options [Boolean] :dry_run
757
+ # Checks whether you have the required permissions for the action,
758
+ # without actually making the request, and provides an error response.
759
+ # If you have the required permissions, the error response is
760
+ # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
652
761
  # @return [EmptyStructure]
653
762
  def modify_attribute(options = {})
654
763
  options = options.merge(image_id: @id)
655
- resp = Aws::Plugins::UserAgent.feature('resource') do
764
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
656
765
  @client.modify_image_attribute(options)
657
766
  end
658
767
  resp.data
@@ -676,7 +785,7 @@ module Aws::EC2
676
785
  # @return [EmptyStructure]
677
786
  def reset_attribute(options = {})
678
787
  options = options.merge(image_id: @id)
679
- resp = Aws::Plugins::UserAgent.feature('resource') do
788
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
680
789
  @client.reset_image_attribute(options)
681
790
  end
682
791
  resp.data