aws-sdk-s3control 1.41.1 → 1.42.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb18d70c47a61e80a060b5724b6f9e084f69eebbf0c9d41ba4bdecb6c9919b69
4
- data.tar.gz: 2c31f9060b0ad907eed64a0bdc9a6a24bcc93f1c410794cd8e3e0de211e4f170
3
+ metadata.gz: 3d717b8608be6b064bafa5fd3bfe4cab6a0bd53200071478dcddb696a087c3ed
4
+ data.tar.gz: 66b70379fe4e6040954b137ec45e5e67d67f9f8d05598c3e9fc950e3314712c6
5
5
  SHA512:
6
- metadata.gz: 76a114672bc68c8abf9bb439b2f31619ab568385741cff18a7a3bf36cfe667daa10f72a074ab57a07f5f71e590c44f77e1e2882ef4feb0f3379b9b5106ce8cf8
7
- data.tar.gz: 7666c8fa181b21dbd20e0f92cd3a35a36915a9fde553259ad48830ddf227851e255bc885fc2235629d2d97cf7bde69238efa6b7f2d2625edfda4c3588e7d0333
6
+ metadata.gz: 4608d26f4f298e23c24f5656bb05308175694e9154d054a96b983284b9836bb52f24ac39b45e373fb5189fc0cb6b0ea4385d34f35d8954458cd61fbeeb384c43
7
+ data.tar.gz: 9fad7cb5825ed52608717ace057089b3c1d3b9feb43a83cfbb73d0a51d10c2bce2c94cf0177ce8430b00edd3ac021a73ccb99e7642118b6b7fd2223078cfaad4
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.42.0 (2021-11-04)
5
+ ------------------
6
+
7
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
8
+
9
+ * Feature - Support FIPS endpoints for S3 Outposts using Bucket and Access Point ARNs.
10
+
4
11
  1.41.1 (2021-10-20)
5
12
  ------------------
6
13
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.41.1
1
+ 1.42.0
@@ -23,30 +23,36 @@ module Aws
23
23
  end
24
24
 
25
25
  def support_fips?
26
- false
26
+ true
27
27
  end
28
28
 
29
29
  def validate_arn!
30
30
  unless @service == 's3-outposts'
31
- raise ArgumentError, 'Must provide a valid S3 outposts ARN.'
31
+ raise ArgumentError, 'Must provide a valid S3 Outpost Access '\
32
+ 'Point ARN.'
32
33
  end
33
34
 
34
35
  if @region.empty? || @account_id.empty?
35
36
  raise ArgumentError,
36
- 'S3 accesspoint ARNs must contain both a region '\
37
- 'and an account id.'
37
+ 'S3 Outpost Access Point ARNs must contain both a region '\
38
+ 'and an Account ID.'
39
+ end
40
+
41
+ if @region.include?('-fips') || @region.include?('fips-')
42
+ raise ArgumentError,
43
+ 'S3 Outpost Access Point ARNs cannot contain a FIPS region.'
38
44
  end
39
45
 
40
46
  if @type != 'outpost' && @subtype != 'accesspoint'
41
- raise ArgumentError, 'Invalid ARN, resource format is not correct'
47
+ raise ArgumentError, 'Invalid ARN, resource format is not correct.'
42
48
  end
43
49
 
44
50
  if @outpost_id.nil? || @outpost_id.empty?
45
- raise ArgumentError, 'Missing ARN outpost id.'
51
+ raise ArgumentError, 'Missing ARN Outpost ID.'
46
52
  end
47
53
 
48
54
  if @access_point_name.nil? || @access_point_name.empty?
49
- raise ArgumentError, 'Missing ARN accesspoint name.'
55
+ raise ArgumentError, 'Missing ARN Access Point name.'
50
56
  end
51
57
 
52
58
  if @extra
@@ -68,11 +74,11 @@ module Aws
68
74
  end
69
75
 
70
76
  # Outpost Access Point ARNs currently do not support dualstack
71
- def host_url(region, _dualstack = false, custom_endpoint = nil)
77
+ def host_url(region, fips = false, _dualstack = false, custom_endpoint = nil)
72
78
  if custom_endpoint
73
79
  custom_endpoint
74
80
  else
75
- "s3-outposts.#{region}.amazonaws.com"
81
+ "s3-outposts#{'-fips' if fips}.#{region}.amazonaws.com"
76
82
  end
77
83
  end
78
84
  end
@@ -28,13 +28,18 @@ module Aws
28
28
 
29
29
  def validate_arn!
30
30
  unless @service == 's3-outposts'
31
- raise ArgumentError, 'Must provide a valid S3 outposts bucket ARN.'
31
+ raise ArgumentError, 'Must provide a valid S3 Outpost Bucket ARN.'
32
32
  end
33
33
 
34
34
  if @region.empty? || @account_id.empty?
35
35
  raise ArgumentError,
36
- 'S3 accesspoint ARNs must contain both a region '\
37
- 'and an account id.'
36
+ 'S3 Outpost Bucket ARNs must contain both a region '\
37
+ 'and an Account ID.'
38
+ end
39
+
40
+ if @region.include?('-fips') || @region.include?('fips-')
41
+ raise ArgumentError,
42
+ 'S3 Outpost Bucket ARNs cannot contain a FIPS region.'
38
43
  end
39
44
 
40
45
  if @type != 'outpost' && @subtype != 'bucket'
@@ -42,16 +47,16 @@ module Aws
42
47
  end
43
48
 
44
49
  if @outpost_id.nil? || @outpost_id.empty?
45
- raise ArgumentError, 'Missing ARN outpost id.'
50
+ raise ArgumentError, 'Missing ARN Outpost ID.'
46
51
  end
47
52
 
48
53
  if @bucket_name.nil? || @bucket_name.empty?
49
- raise ArgumentError, 'Missing ARN accesspoint name.'
54
+ raise ArgumentError, 'Missing ARN bucket name.'
50
55
  end
51
56
 
52
57
  if @extra
53
58
  raise ArgumentError,
54
- 'ARN outpost bucket must be a single value.'
59
+ 'ARN Outpost bucket must be a single value.'
55
60
  end
56
61
 
57
62
  unless Seahorse::Util.host_label?(@outpost_id)
@@ -64,11 +69,11 @@ module Aws
64
69
  end
65
70
 
66
71
  # Outpost Bucket ARNs currently do not support dualstack
67
- def host_url(region, _dualstack = false, custom_endpoint = nil)
72
+ def host_url(region, fips = false, _dualstack = false, custom_endpoint = nil)
68
73
  if custom_endpoint
69
74
  custom_endpoint
70
75
  else
71
- "s3-outposts.#{region}.amazonaws.com"
76
+ "s3-outposts#{'-fips' if fips}.#{region}.amazonaws.com"
72
77
  end
73
78
  end
74
79
  end
@@ -287,9 +287,14 @@ module Aws::S3Control
287
287
  # ** Please note ** When response stubbing is enabled, no HTTP
288
288
  # requests are made, and retries are disabled.
289
289
  #
290
- # @option options [Boolean] :use_dualstack_endpoint (false)
291
- # When set to `true`, IPv6-compatible bucket endpoints will be used
292
- # for all operations.
290
+ # @option options [Boolean] :use_dualstack_endpoint
291
+ # When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
292
+ # will be used if available.
293
+ #
294
+ # @option options [Boolean] :use_fips_endpoint
295
+ # When set to `true`, fips compatible endpoints will be used if available.
296
+ # When a `fips` region is used, the region is normalized and this config
297
+ # is set to `true`.
293
298
  #
294
299
  # @option options [Boolean] :validate_params (true)
295
300
  # When `true`, request parameters are validated before
@@ -4652,7 +4657,7 @@ module Aws::S3Control
4652
4657
  params: params,
4653
4658
  config: config)
4654
4659
  context[:gem_name] = 'aws-sdk-s3control'
4655
- context[:gem_version] = '1.41.1'
4660
+ context[:gem_version] = '1.42.0'
4656
4661
  Seahorse::Client::Request.new(handlers, context)
4657
4662
  end
4658
4663
 
@@ -39,6 +39,7 @@ client's region instead.
39
39
  context.http_request.endpoint,
40
40
  context.metadata[:s3_arn][:arn],
41
41
  context.metadata[:s3_arn][:resolved_region],
42
+ context.metadata[:s3_arn][:fips],
42
43
  context.metadata[:s3_arn][:dualstack],
43
44
  # if regional_endpoint is false, a custom endpoint was provided
44
45
  # in this case, we want to prefix the endpoint using the ARN
@@ -78,6 +79,7 @@ client's region instead.
78
79
  context.metadata[:s3_arn] = {
79
80
  arn: arn,
80
81
  resolved_region: resolved_region,
82
+ fips: context.config.use_fips_endpoint,
81
83
  dualstack: extract_dualstack_config!(context)
82
84
  }
83
85
  end
@@ -121,8 +123,8 @@ client's region instead.
121
123
  def validate_config!(context, arn)
122
124
  if !arn.support_dualstack? && context[:use_dualstack_endpoint]
123
125
  raise ArgumentError,
124
- 'Cannot provide an Outpost Access Point ARN when '\
125
- '`:use_dualstack_endpoint` is set to true.'
126
+ 'Cannot provide an Outpost Access Point or Bucket ARN '\
127
+ 'when `:use_dualstack_endpoint` is set to true.'
126
128
  end
127
129
  end
128
130
 
@@ -165,9 +167,9 @@ client's region instead.
165
167
  end
166
168
 
167
169
  # @api private
168
- def resolve_url!(url, arn, region, dualstack = false, has_custom_endpoint = false)
170
+ def resolve_url!(url, arn, region, fips = false, dualstack = false, has_custom_endpoint = false)
169
171
  custom_endpoint = url.host if has_custom_endpoint
170
- url.host = arn.host_url(region, dualstack, custom_endpoint)
172
+ url.host = arn.host_url(region, fips, dualstack, custom_endpoint)
171
173
  url
172
174
  end
173
175
 
@@ -189,35 +191,13 @@ client's region instead.
189
191
  end
190
192
 
191
193
  def validate_region_config!(arn, region, use_arn_region)
192
- fips = arn.support_fips?
193
-
194
- # s3-external-1 is specific just to s3 and not part of partitions
195
- # aws-global is a partition region
196
- unless arn.partition == 'aws' &&
197
- (region == 's3-external-1' || region == 'aws-global')
198
- if !fips && arn.region.include?('fips')
199
- raise ArgumentError,
200
- 'FIPS region ARNs are not supported for this type of ARN.'
201
- end
202
-
203
- if !fips && !use_arn_region && region.include?('fips')
204
- raise ArgumentError,
205
- 'FIPS client regions are not supported for this type of '\
206
- 'ARN without `:s3_use_arn_region`.'
207
- end
208
-
209
- # if it's a fips region, attempt to normalize it
210
- if fips || use_arn_region
211
- region = region.gsub('fips-', '').gsub('-fips', '')
212
- end
213
- if use_arn_region &&
214
- !Aws::Partitions.partition(arn.partition).region?(region)
215
- raise Aws::Errors::InvalidARNPartitionError
216
- end
194
+ if use_arn_region &&
195
+ !Aws::Partitions.partition(arn.partition).region?(region)
196
+ raise Aws::Errors::InvalidARNPartitionError
197
+ end
217
198
 
218
- if !use_arn_region && region != arn.region
219
- raise Aws::Errors::InvalidARNRegionError
220
- end
199
+ if !use_arn_region && region != arn.region
200
+ raise Aws::Errors::InvalidARNRegionError
221
201
  end
222
202
  end
223
203
  end
@@ -5,15 +5,6 @@ module Aws
5
5
  module Plugins
6
6
  # @api private
7
7
  class Dualstack < Seahorse::Client::Plugin
8
-
9
- option(:use_dualstack_endpoint,
10
- default: false,
11
- doc_type: 'Boolean',
12
- docstring: <<-DOCS)
13
- When set to `true`, IPv6-compatible bucket endpoints will be used
14
- for all operations.
15
- DOCS
16
-
17
8
  def add_handlers(handlers, config)
18
9
  handlers.add(OptionHandler, step: :initialize)
19
10
  handlers.add(DualstackHandler, step: :build, priority: 11)
@@ -40,23 +31,22 @@ for all operations.
40
31
  # @api private
41
32
  class DualstackHandler < Seahorse::Client::Handler
42
33
  def call(context)
43
- if context.config.regional_endpoint && context[:use_dualstack_endpoint]
44
- apply_dualstack_endpoint(context)
34
+ # if it's a regional endpoint and not an ARN, then construct the
35
+ # endpoint. regional endpoint plugin uses the dualstack config
36
+ if context.config.regional_endpoint && !context.metadata[:s3_arn]
37
+ endpoint = Aws::Partitions::EndpointProvider.resolve(
38
+ context.config.region,
39
+ 's3-control',
40
+ 'regional',
41
+ {
42
+ dualstack: context[:use_dualstack_endpoint],
43
+ fips: context.config.use_fips_endpoint
44
+ }
45
+ )
46
+ context.http_request.endpoint = URI.parse(endpoint)
45
47
  end
46
48
  @handler.call(context)
47
49
  end
48
-
49
- private
50
- def apply_dualstack_endpoint(context)
51
- region = context.config.region
52
- dns_suffix = Aws::Partitions::EndpointProvider.dns_suffix_for(region)
53
- host = "s3-control.dualstack.#{region}.#{dns_suffix}"
54
- endpoint = URI.parse(context.http_request.endpoint.to_s)
55
- endpoint.scheme = context.http_request.endpoint.scheme
56
- endpoint.port = context.http_request.endpoint.port
57
- endpoint.host = host
58
- context.http_request.endpoint = endpoint.to_s
59
- end
60
50
  end
61
51
 
62
52
  end
@@ -54,8 +54,9 @@ module Aws
54
54
  # outpost operations should go to the outposts endpoint only if
55
55
  # it's not a custom endpoint. the ARN class changes this for ARNs
56
56
  if context.config.regional_endpoint
57
+ fips = context.config.use_fips_endpoint
57
58
  context.http_request.endpoint.host =
58
- "s3-outposts.#{context.config.region}.amazonaws.com"
59
+ "s3-outposts#{'-fips' if fips}.#{context.config.region}.amazonaws.com"
59
60
  end
60
61
  S3ControlSigner.build_v4_signer(
61
62
  service: 's3-outposts',
@@ -48,6 +48,6 @@ require_relative 'aws-sdk-s3control/customizations'
48
48
  # @!group service
49
49
  module Aws::S3Control
50
50
 
51
- GEM_VERSION = '1.41.1'
51
+ GEM_VERSION = '1.42.0'
52
52
 
53
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-s3control
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.41.1
4
+ version: 1.42.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-20 00:00:00.000000000 Z
11
+ date: 2021-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sigv4
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '3'
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 3.121.2
36
+ version: 3.122.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '3'
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 3.121.2
46
+ version: 3.122.0
47
47
  description: Official AWS Ruby gem for AWS S3 Control. This gem is part of the AWS
48
48
  SDK for Ruby.
49
49
  email: