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
@@ -18,7 +18,9 @@ module Aws
18
18
  private
19
19
 
20
20
  def encrypted_password
21
- bytes = client.get_password_data(instance_id: id).password_data
21
+ bytes = Aws::Plugins::UserAgent.feature('resource') do
22
+ client.get_password_data(instance_id: id).password_data
23
+ end
22
24
  if bytes == ''
23
25
  raise 'password not available yet'
24
26
  else
@@ -5,7 +5,9 @@ module Aws
5
5
  class Resource
6
6
 
7
7
  def create_tags(options)
8
- resp = @client.create_tags(options)
8
+ resp = Aws::Plugins::UserAgent.feature('resource') do
9
+ @client.create_tags(options)
10
+ end
9
11
  tags = []
10
12
  options[:resources].each do |resource_id|
11
13
  options[:tags].each do |tag|
@@ -35,7 +35,7 @@ module Aws::EC2
35
35
  end
36
36
  alias :dhcp_options_id :id
37
37
 
38
- # One or more DHCP options in the set.
38
+ # The DHCP options in the set.
39
39
  # @return [Array<Types::DhcpConfiguration>]
40
40
  def dhcp_configurations
41
41
  data[:dhcp_configurations]
@@ -68,7 +68,9 @@ module Aws::EC2
68
68
  #
69
69
  # @return [self]
70
70
  def load
71
- resp = @client.describe_dhcp_options(dhcp_options_ids: [@id])
71
+ resp = Aws::Plugins::UserAgent.feature('resource') do
72
+ @client.describe_dhcp_options(dhcp_options_ids: [@id])
73
+ end
72
74
  @data = resp.dhcp_options[0]
73
75
  self
74
76
  end
@@ -183,7 +185,9 @@ module Aws::EC2
183
185
  :retry
184
186
  end
185
187
  end
186
- Aws::Waiters::Waiter.new(options).wait({})
188
+ Aws::Plugins::UserAgent.feature('resource') do
189
+ Aws::Waiters::Waiter.new(options).wait({})
190
+ end
187
191
  end
188
192
 
189
193
  # @!group Actions
@@ -205,7 +209,9 @@ module Aws::EC2
205
209
  # @return [EmptyStructure]
206
210
  def associate_with_vpc(options = {})
207
211
  options = options.merge(dhcp_options_id: @id)
208
- resp = @client.associate_dhcp_options(options)
212
+ resp = Aws::Plugins::UserAgent.feature('resource') do
213
+ @client.associate_dhcp_options(options)
214
+ end
209
215
  resp.data
210
216
  end
211
217
 
@@ -234,7 +240,9 @@ module Aws::EC2
234
240
  def create_tags(options = {})
235
241
  batch = []
236
242
  options = Aws::Util.deep_merge(options, resources: [@id])
237
- resp = @client.create_tags(options)
243
+ resp = Aws::Plugins::UserAgent.feature('resource') do
244
+ @client.create_tags(options)
245
+ end
238
246
  options[:tags].each do |t|
239
247
  batch << Tag.new(
240
248
  resource_id: @id,
@@ -279,7 +287,9 @@ module Aws::EC2
279
287
  def delete_tags(options = {})
280
288
  batch = []
281
289
  options = Aws::Util.deep_merge(options, resources: [@id])
282
- resp = @client.delete_tags(options)
290
+ resp = Aws::Plugins::UserAgent.feature('resource') do
291
+ @client.delete_tags(options)
292
+ end
283
293
  options[:tags].each do |t|
284
294
  batch << Tag.new(
285
295
  resource_id: @id,
@@ -305,7 +315,9 @@ module Aws::EC2
305
315
  # @return [EmptyStructure]
306
316
  def delete(options = {})
307
317
  options = options.merge(dhcp_options_id: @id)
308
- resp = @client.delete_dhcp_options(options)
318
+ resp = Aws::Plugins::UserAgent.feature('resource') do
319
+ @client.delete_dhcp_options(options)
320
+ end
309
321
  resp.data
310
322
  end
311
323
 
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::EC2
11
+ # Endpoint parameters used to influence endpoints per request.
12
+ #
13
+ # @!attribute region
14
+ # The AWS region used to dispatch the request.
15
+ #
16
+ # @return [String]
17
+ #
18
+ # @!attribute use_dual_stack
19
+ # When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
20
+ #
21
+ # @return [Boolean]
22
+ #
23
+ # @!attribute use_fips
24
+ # When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
25
+ #
26
+ # @return [Boolean]
27
+ #
28
+ # @!attribute endpoint
29
+ # Override the endpoint used to send this request
30
+ #
31
+ # @return [String]
32
+ #
33
+ EndpointParameters = Struct.new(
34
+ :region,
35
+ :use_dual_stack,
36
+ :use_fips,
37
+ :endpoint,
38
+ ) do
39
+ include Aws::Structure
40
+
41
+ # @api private
42
+ class << self
43
+ PARAM_MAP = {
44
+ 'Region' => :region,
45
+ 'UseDualStack' => :use_dual_stack,
46
+ 'UseFIPS' => :use_fips,
47
+ 'Endpoint' => :endpoint,
48
+ }.freeze
49
+ end
50
+
51
+ def initialize(options = {})
52
+ self[:region] = options[:region]
53
+ self[:use_dual_stack] = options[:use_dual_stack]
54
+ self[:use_dual_stack] = false if self[:use_dual_stack].nil?
55
+ if self[:use_dual_stack].nil?
56
+ raise ArgumentError, "Missing required EndpointParameter: :use_dual_stack"
57
+ end
58
+ self[:use_fips] = options[:use_fips]
59
+ self[:use_fips] = false if self[:use_fips].nil?
60
+ if self[:use_fips].nil?
61
+ raise ArgumentError, "Missing required EndpointParameter: :use_fips"
62
+ end
63
+ self[:endpoint] = options[:endpoint]
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::EC2
11
+ class EndpointProvider
12
+ def resolve_endpoint(parameters)
13
+ region = parameters.region
14
+ use_dual_stack = parameters.use_dual_stack
15
+ use_fips = parameters.use_fips
16
+ endpoint = parameters.endpoint
17
+ if Aws::Endpoints::Matchers.set?(endpoint)
18
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
19
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
20
+ end
21
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
22
+ raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
23
+ end
24
+ return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
25
+ end
26
+ if Aws::Endpoints::Matchers.set?(region)
27
+ if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
28
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
29
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
30
+ return Aws::Endpoints::Endpoint.new(url: "https://ec2-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
31
+ end
32
+ raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
33
+ end
34
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
35
+ if Aws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"), true)
36
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-us-gov")
37
+ return Aws::Endpoints::Endpoint.new(url: "https://ec2.#{region}.amazonaws.com", headers: {}, properties: {})
38
+ end
39
+ return Aws::Endpoints::Endpoint.new(url: "https://ec2-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
40
+ end
41
+ raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
42
+ end
43
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
44
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
45
+ return Aws::Endpoints::Endpoint.new(url: "https://ec2.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
46
+ end
47
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
48
+ end
49
+ return Aws::Endpoints::Endpoint.new(url: "https://ec2.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
50
+ end
51
+ end
52
+ raise ArgumentError, "Invalid Configuration: Missing Region"
53
+ raise ArgumentError, 'No endpoint could be resolved'
54
+
55
+ end
56
+ end
57
+ end