aws-sdk-core 3.131.3 → 3.176.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +330 -1
  3. data/VERSION +1 -1
  4. data/lib/aws-defaults/default_configuration.rb +4 -4
  5. data/lib/aws-sdk-core/arn.rb +13 -0
  6. data/lib/aws-sdk-core/binary/encode_handler.rb +12 -1
  7. data/lib/aws-sdk-core/credential_provider.rb +3 -0
  8. data/lib/aws-sdk-core/credential_provider_chain.rb +8 -5
  9. data/lib/aws-sdk-core/ecs_credentials.rb +111 -53
  10. data/lib/aws-sdk-core/endpoints/condition.rb +41 -0
  11. data/lib/aws-sdk-core/endpoints/endpoint.rb +17 -0
  12. data/lib/aws-sdk-core/endpoints/endpoint_rule.rb +75 -0
  13. data/lib/aws-sdk-core/endpoints/error_rule.rb +42 -0
  14. data/lib/aws-sdk-core/endpoints/function.rb +80 -0
  15. data/lib/aws-sdk-core/endpoints/matchers.rb +127 -0
  16. data/lib/aws-sdk-core/endpoints/reference.rb +31 -0
  17. data/lib/aws-sdk-core/endpoints/rule.rb +25 -0
  18. data/lib/aws-sdk-core/endpoints/rule_set.rb +52 -0
  19. data/lib/aws-sdk-core/endpoints/rules_provider.rb +37 -0
  20. data/lib/aws-sdk-core/endpoints/templater.rb +58 -0
  21. data/lib/aws-sdk-core/endpoints/tree_rule.rb +45 -0
  22. data/lib/aws-sdk-core/endpoints/url.rb +60 -0
  23. data/lib/aws-sdk-core/endpoints.rb +78 -0
  24. data/lib/aws-sdk-core/errors.rb +13 -0
  25. data/lib/aws-sdk-core/json/error_handler.rb +20 -1
  26. data/lib/aws-sdk-core/log/formatter.rb +6 -0
  27. data/lib/aws-sdk-core/pageable_response.rb +10 -1
  28. data/lib/aws-sdk-core/plugins/bearer_authorization.rb +67 -0
  29. data/lib/aws-sdk-core/plugins/checksum_algorithm.rb +1 -1
  30. data/lib/aws-sdk-core/plugins/credentials_configuration.rb +24 -0
  31. data/lib/aws-sdk-core/plugins/endpoint_discovery.rb +6 -2
  32. data/lib/aws-sdk-core/plugins/recursion_detection.rb +14 -3
  33. data/lib/aws-sdk-core/plugins/regional_endpoint.rb +5 -0
  34. data/lib/aws-sdk-core/plugins/retries/error_inspector.rb +2 -1
  35. data/lib/aws-sdk-core/plugins/sign.rb +201 -0
  36. data/lib/aws-sdk-core/plugins/signature_v2.rb +1 -0
  37. data/lib/aws-sdk-core/plugins/signature_v4.rb +13 -7
  38. data/lib/aws-sdk-core/plugins/user_agent.rb +117 -14
  39. data/lib/aws-sdk-core/refreshing_credentials.rb +0 -6
  40. data/lib/aws-sdk-core/refreshing_token.rb +71 -0
  41. data/lib/aws-sdk-core/rest/request/headers.rb +2 -6
  42. data/lib/aws-sdk-core/shared_config.rb +78 -6
  43. data/lib/aws-sdk-core/sso_credentials.rb +80 -45
  44. data/lib/aws-sdk-core/sso_token_provider.rb +135 -0
  45. data/lib/aws-sdk-core/static_token_provider.rb +14 -0
  46. data/lib/aws-sdk-core/structure.rb +6 -4
  47. data/lib/aws-sdk-core/token.rb +31 -0
  48. data/lib/aws-sdk-core/token_provider.rb +15 -0
  49. data/lib/aws-sdk-core/token_provider_chain.rb +51 -0
  50. data/lib/aws-sdk-core/waiters/poller.rb +3 -1
  51. data/lib/aws-sdk-core/xml/parser/engines/oga.rb +2 -0
  52. data/lib/aws-sdk-core.rb +14 -0
  53. data/lib/aws-sdk-sso/client.rb +56 -11
  54. data/lib/aws-sdk-sso/endpoint_parameters.rb +66 -0
  55. data/lib/aws-sdk-sso/endpoint_provider.rb +51 -0
  56. data/lib/aws-sdk-sso/endpoints.rb +72 -0
  57. data/lib/aws-sdk-sso/plugins/endpoints.rb +76 -0
  58. data/lib/aws-sdk-sso/types.rb +8 -43
  59. data/lib/aws-sdk-sso.rb +5 -1
  60. data/lib/aws-sdk-ssooidc/client.rb +611 -0
  61. data/lib/aws-sdk-ssooidc/client_api.rb +216 -0
  62. data/lib/aws-sdk-ssooidc/customizations.rb +1 -0
  63. data/lib/aws-sdk-ssooidc/endpoint_parameters.rb +66 -0
  64. data/lib/aws-sdk-ssooidc/endpoint_provider.rb +51 -0
  65. data/lib/aws-sdk-ssooidc/endpoints.rb +58 -0
  66. data/lib/aws-sdk-ssooidc/errors.rb +290 -0
  67. data/lib/aws-sdk-ssooidc/plugins/endpoints.rb +74 -0
  68. data/lib/aws-sdk-ssooidc/resource.rb +26 -0
  69. data/lib/aws-sdk-ssooidc/types.rb +502 -0
  70. data/lib/aws-sdk-ssooidc.rb +59 -0
  71. data/lib/aws-sdk-sts/client.rb +263 -243
  72. data/lib/aws-sdk-sts/endpoint_parameters.rb +78 -0
  73. data/lib/aws-sdk-sts/endpoint_provider.rb +112 -0
  74. data/lib/aws-sdk-sts/endpoints.rb +136 -0
  75. data/lib/aws-sdk-sts/plugins/endpoints.rb +84 -0
  76. data/lib/aws-sdk-sts/presigner.rb +13 -15
  77. data/lib/aws-sdk-sts/types.rb +87 -195
  78. data/lib/aws-sdk-sts.rb +5 -1
  79. data/lib/seahorse/client/async_base.rb +0 -1
  80. data/lib/seahorse/client/configuration.rb +2 -2
  81. data/lib/seahorse/client/h2/connection.rb +12 -11
  82. data/lib/seahorse/client/plugins/request_callback.rb +9 -9
  83. data/lib/seahorse/util.rb +4 -0
  84. metadata +47 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 841c00d0f15577e794600c6d510e131c28c5daceaf682ea8f037b672600d2ba1
4
- data.tar.gz: 8c1036761b99ae9d06809e8382a3abf7c018852616a26bfb907981550b960b9f
3
+ metadata.gz: f6a876821436f937b2d49db79cb78a374e24cdb7dad61715d4113a9558930bb5
4
+ data.tar.gz: ed84f2f3a77a651c58cb0cc71f66483b20e1f96f6e8f7b6b2001301263136845
5
5
  SHA512:
6
- metadata.gz: 4fb0e66c9f849349f474881b161b81f5b07d6258998d741b12203a6814c79f029e70651c8da0aa364255e70ce89a1ed94a4e45376087e81ea4d37d391131138a
7
- data.tar.gz: 2ac018694538ba648287e3080ecd0e9bffcd350abc1f5a0a15f958a544b94d1f8d88ac245f20bd2708488b24e189137aeee40f8ae0e34b62c3be71cf197214ed
6
+ metadata.gz: 7391d189f34826cb514a222724eff6f4b1cee8d97d7be3ca9891b689ea854ee6175549e409933ceb2da3d54d6a5b18e8ce132a442b1ddb3a32b7c9922486df44
7
+ data.tar.gz: bf69da8132d6940fb7d49742a22803160f5fb8d4e8cf90665e557af50cbbfec0f83756f4a5df40e378495eac88950c242937b7fbacf9e16d9b937b531f67df9e
data/CHANGELOG.md CHANGED
@@ -1,10 +1,339 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 3.176.1 (2023-06-29)
5
+ ------------------
6
+
7
+ * Issue - Fix signing for S3/S3 Control and `aws-crt` gem for certain object keys (#2849).
8
+
9
+ * Issue - Ensure `SSOCredentials` `#expiration` is a `Time` (#2874)
10
+
11
+ 3.176.0 (2023-06-28)
12
+ ------------------
13
+
14
+ * Feature - Add :expiration accessor to `CredentialProvider` and do not refresh credentials when checking expiration (#2872).
15
+
16
+ 3.175.0 (2023-06-15)
17
+ ------------------
18
+
19
+ * Feature - Updated Aws::STS::Client with the latest API changes.
20
+
21
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
22
+
23
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
24
+
25
+ 3.174.0 (2023-05-31)
26
+ ------------------
27
+
28
+ * Feature - Updated Aws::STS::Client with the latest API changes.
29
+
30
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
31
+
32
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
33
+
34
+ * Feature - Improve User-Agent metrics tracking.
35
+
36
+ 3.173.1 (2023-05-24)
37
+ ------------------
38
+
39
+ * Issue - Updated `checksum_algorithm` plugin to use IO.copy_stream for JRuby.
40
+
41
+ 3.173.0 (2023-05-18)
42
+ ------------------
43
+
44
+ * Feature - Updated Aws::STS::Client with the latest API changes.
45
+
46
+ 3.172.0 (2023-05-08)
47
+ ------------------
48
+
49
+ * Feature - Updated Aws::STS::Client with the latest API changes.
50
+
51
+ * Feature - Add :region option to `Aws::Log::Formatter`.
52
+
53
+ 3.171.1 (2023-05-04)
54
+ ------------------
55
+
56
+ * Issue - Fix error code parsing in AWS query compatible JSON services.
57
+
58
+ 3.171.0 (2023-03-22)
59
+ ------------------
60
+
61
+ * Feature - Add support for `AWS_CONTAINER_CREDENTIALS_FULL_URI` and `AWS_CONTAINER_AUTHORIZATION_TOKEN` environment variables to `ECSCredentials`.
62
+
63
+ 3.170.1 (2023-03-17)
64
+ ------------------
65
+
66
+ * Issue - Reduce memory usage in H2::Connection when `http_wire_log` is not set.
67
+
68
+ 3.170.0 (2023-01-25)
69
+ ------------------
70
+
71
+ * Feature - Updated Aws::STS::Client with the latest API changes.
72
+
73
+ 3.169.0 (2023-01-18)
74
+ ------------------
75
+
76
+ * Feature - Updated Aws::STS::Client with the latest API changes.
77
+
78
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
79
+
80
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
81
+
82
+ * Issue - Replace runtime endpoint resolution approach with generated ruby code for STS, SSO, and SSOOIDC.
83
+
84
+ 3.168.4 (2022-12-08)
85
+ ------------------
86
+
87
+ * Issue - Fix Sign to not sign Sigv2 requests to S3.
88
+
89
+ 3.168.3 (2022-12-02)
90
+ ------------------
91
+
92
+ * Issue - Retry S3's `BadDigest` error
93
+
94
+ 3.168.2 (2022-11-29)
95
+ ------------------
96
+
97
+ * Issue - Allow region resolution in `AssumeRoleCredentials` from `CredentialProviderChain`.
98
+
99
+ 3.168.1 (2022-11-18)
100
+ ------------------
101
+
102
+ * Issue - Fix initialization of SSOTokenProvider when `AWS_PROFILE` is specified.
103
+
104
+ 3.168.0 (2022-11-17)
105
+ ------------------
106
+
107
+ * Feature - Updated Aws::STS::Client with the latest API changes.
108
+
109
+ 3.167.0 (2022-11-09)
110
+ ------------------
111
+
112
+ * Issue - Ensure the stream_thread is not killed before H2 connection status is updated (#2779).
113
+
114
+ * Feature - Add token refresh support to `SSOCredentialProvider`.
115
+
116
+ 3.166.0 (2022-10-26)
117
+ ------------------
118
+
119
+ * Feature - Updated Aws::STS::Client with the latest API changes.
120
+
121
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
122
+
123
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
124
+
125
+ 3.165.1 (2022-10-25)
126
+ ------------------
127
+
128
+ * Issue - Require the SignatureV4 plugin to fix compatability with older `aws-sdk-s3` versions (#2774).
129
+
130
+ 3.165.0 (2022-10-25)
131
+ ------------------
132
+
133
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
134
+
135
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
136
+
137
+ * Feature - Add support for service gems to dynamically determine their own endpoints via modeling. Service gems now generate a plugin called "Endpoints" that defines configuration for EndpointProvider, a new public type, and any client config related to endpoints. Endpoint providers will resolve values using another new public type, Endpoint Parameters, generated for each service. The plugin will use the endpoint provider to resolve an endpoint and then apply it to the request prior to serialization. Endpoint providers can be composed to change endpoint resolution logic, i.e. for testing. In addition to endpoints, the endpoint provider may also override the authentication scheme (auth scheme) which details how the request should be signed for the endpoint. A new "Sign" plugin in core replaces the SignatureV4 plugin that will generically sign any type of auth scheme that a service might have.
138
+
139
+ 3.164.0 (2022-10-21)
140
+ ------------------
141
+
142
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
143
+
144
+ 3.163.0 (2022-10-20)
145
+ ------------------
146
+
147
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
148
+
149
+ 3.162.0 (2022-10-19)
150
+ ------------------
151
+
152
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
153
+
154
+ 3.161.0 (2022-10-18)
155
+ ------------------
156
+
157
+ * Feature - Support AwsQueryCompatible trait to read error code from x-amzn-query-error header.
158
+
159
+ 3.160.0 (2022-10-13)
160
+ ------------------
161
+
162
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
163
+
164
+ 3.159.0 (2022-10-07)
165
+ ------------------
166
+
167
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
168
+
169
+ 3.158.1 (2022-10-06)
170
+ ------------------
171
+
172
+ * Issue - Ensure that the ReadCallbackIO is always unwrapped (#2761).
173
+
174
+ 3.158.0 (2022-09-30)
175
+ ------------------
176
+
177
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
178
+
179
+ 3.157.0 (2022-09-29)
180
+ ------------------
181
+
182
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
183
+
184
+ 3.156.0 (2022-09-27)
185
+ ------------------
186
+
187
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
188
+
189
+ 3.155.0 (2022-09-26)
190
+ ------------------
191
+
192
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
193
+
194
+ 3.154.0 (2022-09-23)
195
+ ------------------
196
+
197
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
198
+
199
+ 3.153.0 (2022-09-22)
200
+ ------------------
201
+
202
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
203
+
204
+ 3.152.0 (2022-09-21)
205
+ ------------------
206
+
207
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
208
+
209
+ 3.151.0 (2022-09-20)
210
+ ------------------
211
+
212
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
213
+
214
+ 3.150.0 (2022-09-19)
215
+ ------------------
216
+
217
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
218
+
219
+ 3.149.0 (2022-09-16)
220
+ ------------------
221
+
222
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
223
+
224
+ 3.148.0 (2022-09-15)
225
+ ------------------
226
+
227
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
228
+
229
+ 3.147.0 (2022-09-14)
230
+ ------------------
231
+
232
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
233
+
234
+ 3.146.0 (2022-09-13)
235
+ ------------------
236
+
237
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
238
+
239
+ 3.145.0 (2022-09-12)
240
+ ------------------
241
+
242
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
243
+
244
+ 3.144.0 (2022-09-09)
245
+ ------------------
246
+
247
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
248
+
249
+ 3.143.0 (2022-09-08)
250
+ ------------------
251
+
252
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
253
+
254
+ 3.142.0 (2022-09-07)
255
+ ------------------
256
+
257
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
258
+
259
+ 3.141.0 (2022-09-06)
260
+ ------------------
261
+
262
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
263
+
264
+ 3.140.0 (2022-09-02)
265
+ ------------------
266
+
267
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
268
+
269
+ 3.139.0 (2022-09-01)
270
+ ------------------
271
+
272
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
273
+
274
+ 3.138.0 (2022-08-31)
275
+ ------------------
276
+
277
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
278
+
279
+ 3.137.0 (2022-08-30)
280
+ ------------------
281
+
282
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
283
+
284
+ * Issue - Fix errors in recursion detection when `_X_AMZN_TRACE_ID` is unset (#2748).
285
+
286
+ 3.136.0 (2022-08-25)
287
+ ------------------
288
+
289
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
290
+
291
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
292
+
293
+ 3.135.0 (2022-08-24)
294
+ ------------------
295
+
296
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
297
+
298
+ 3.134.0 (2022-08-23)
299
+ ------------------
300
+
301
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
302
+
303
+ * Feature - Add support for Bearer Token Authentication and TokenProviders.
304
+
305
+ * Issue - Validate that `_X_AMZN_TRACE_ID` ENV value contains only valid, non-control characters.
306
+
307
+ 3.133.0 (2022-08-22)
308
+ ------------------
309
+
310
+ * Feature - Moved functionality from `aws-sdk-ssooidc` into core.
311
+
312
+ 3.132.0 (2022-08-08)
313
+ ------------------
314
+
315
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
316
+
317
+ 3.131.6 (2022-08-03)
318
+ ------------------
319
+
320
+ * Issue - Fix typo in `RecursionDetection`, change amz to amzn in header and env name.
321
+
322
+ 3.131.5 (2022-07-28)
323
+ ------------------
324
+
325
+ * Issue - Fix `to_json` usage in nested hashes by defining `as_json` (#2733).
326
+
327
+ 3.131.4 (2022-07-27)
328
+ ------------------
329
+
330
+ * Issue - Fix `to_json` usage on pageable responses when using Rails (#2733).
331
+ * Issue - Use `expand_path` on credential/config paths in SharedConfig (#2735).
332
+
4
333
  3.131.3 (2022-07-18)
5
334
  ------------------
6
335
 
7
- * Issue - Add support for serializing shapes on the body with `jsonvalue` members.
336
+ * Issue - Add support for serializing shapes on the body with `jsonvalue` members.
8
337
 
9
338
  3.131.2 (2022-06-20)
10
339
  ------------------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.131.3
1
+ 3.176.1
@@ -20,7 +20,7 @@ module Aws
20
20
  # * Globally via the "AWS_DEFAULTS_MODE" environment variable.
21
21
  #
22
22
  #
23
- # @code_generation START - documentation
23
+ # #defaults START - documentation
24
24
  # The following `:default_mode` values are supported:
25
25
  #
26
26
  # * `'standard'` -
@@ -105,10 +105,10 @@ module Aws
105
105
  # [2]: https://docs.aws.amazon.com/sdkref/latest/guide/setting-global-retry_mode.html
106
106
  # [3]: https://docs.aws.amazon.com/sdkref/latest/guide/setting-global-sts_regional_endpoints.html
107
107
  #
108
- # @code_generation END - documentation
108
+ # #defaults END - documentation
109
109
  module DefaultsModeConfiguration
110
110
  # @api private
111
- # @code_generation START - configuration
111
+ # #defaults START - configuration
112
112
  SDK_DEFAULT_CONFIGURATION =
113
113
  {
114
114
  "version" => 1,
@@ -148,6 +148,6 @@ module Aws
148
148
  }
149
149
  }
150
150
  }
151
- # @code_generation END - configuration
151
+ # #defaults END - configuration
152
152
  end
153
153
  end
@@ -88,5 +88,18 @@ module Aws
88
88
  resource: @resource
89
89
  }
90
90
  end
91
+
92
+ # Return the ARN as JSON
93
+ #
94
+ # @return [Hash]
95
+ def as_json(_options = nil)
96
+ {
97
+ 'partition' => @partition,
98
+ 'service' => @service,
99
+ 'region' => @region,
100
+ 'accountId' => @account_id,
101
+ 'resource' => @resource
102
+ }
103
+ end
91
104
  end
92
105
  end
@@ -13,7 +13,7 @@ module Aws
13
13
  context.config.api.metadata['protocol'],
14
14
  eventstream_member,
15
15
  context.operation.input,
16
- context.config.sigv4_signer
16
+ signer_for(context)
17
17
  )
18
18
  context[:input_event_emitter] = input_es_handler.event_emitter
19
19
  end
@@ -22,6 +22,17 @@ module Aws
22
22
 
23
23
  private
24
24
 
25
+ def signer_for(context)
26
+ # New endpoint/signing logic, use the auth scheme to make a signer
27
+ if context[:auth_scheme]
28
+ Aws::Plugins::Sign.signer_for(context[:auth_scheme], context.config)
29
+ else
30
+ # Previous implementation always assumed sigv4_signer from config.
31
+ # Relies only on sigv4 signing (and plugin) for event stream services
32
+ context.config.sigv4_signer
33
+ end
34
+ end
35
+
25
36
  def eventstream_input?(ctx)
26
37
  ctx.operation.input.shape.members.each do |_, ref|
27
38
  return ref if ref.eventstream
@@ -6,6 +6,9 @@ module Aws
6
6
  # @return [Credentials]
7
7
  attr_reader :credentials
8
8
 
9
+ # @param [Time]
10
+ attr_reader :expiration
11
+
9
12
  # @return [Boolean]
10
13
  def set?
11
14
  !!credentials && credentials.set?
@@ -161,7 +161,8 @@ module Aws
161
161
 
162
162
  def instance_profile_credentials(options)
163
163
  profile_name = determine_profile_name(options)
164
- if ENV['AWS_CONTAINER_CREDENTIALS_RELATIVE_URI']
164
+ if ENV['AWS_CONTAINER_CREDENTIALS_RELATIVE_URI'] ||
165
+ ENV['AWS_CONTAINER_CREDENTIALS_FULL_URI']
165
166
  ECSCredentials.new(options)
166
167
  else
167
168
  InstanceProfileCredentials.new(options.merge(profile: profile_name))
@@ -169,12 +170,14 @@ module Aws
169
170
  end
170
171
 
171
172
  def assume_role_with_profile(options, profile_name)
172
- region = (options[:config] && options[:config].region)
173
- Aws.shared_config.assume_role_credentials_from_config(
173
+ assume_opts = {
174
174
  profile: profile_name,
175
- region: region,
176
175
  chain_config: @config
177
- )
176
+ }
177
+ if options[:config] && options[:config].region
178
+ assume_opts[:region] = options[:config].region
179
+ end
180
+ Aws.shared_config.assume_role_credentials_from_config(assume_opts)
178
181
  end
179
182
  end
180
183
  end