File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def fetch_credentials(options)
21
21
if options [ :use_iam_profile ]
22
22
begin
23
23
role_data = nil
24
- region = options [ :region ] || ENV [ "AWS_DEFAULT_REGION" ]
24
+ region = options [ :region ] || ENV [ "AWS_REGION" ] || ENV [ " AWS_DEFAULT_REGION"]
25
25
26
26
if ENV [ "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" ]
27
27
connection = options [ :connection ] || Excon . new ( CONTAINER_CREDENTIALS_HOST )
Original file line number Diff line number Diff line change 151
151
end
152
152
153
153
ENV [ "AWS_DEFAULT_REGION" ] = "us-west-1"
154
+ ENV [ "AWS_REGION" ] = nil
154
155
155
- tests ( '#fetch_credentials with regional STS endpoint with region in env' ) do
156
+ tests ( '#fetch_credentials with regional STS endpoint with AWS_DEFAULT_REGION in env' ) do
157
+ returns (
158
+ aws_access_key_id : 'dummykey' ,
159
+ aws_secret_access_key : 'dummysecret' ,
160
+ aws_session_token : 'dummytoken' ,
161
+ region : 'us-west-1' ,
162
+ sts_endpoint : "https://sts.us-west-1.amazonaws.com" ,
163
+ aws_credentials_expire_at : expires_at
164
+ ) { Fog ::AWS ::Compute . fetch_credentials ( use_iam_profile : true ) }
165
+ end
166
+
167
+ ENV [ "AWS_DEFAULT_REGION" ] = "us-west-2"
168
+ ENV [ "AWS_REGION" ] = "us-west-1"
169
+
170
+ tests ( '#fetch_credentials with regional STS endpoint with AWS_REGION in env' ) do
156
171
returns (
157
172
aws_access_key_id : 'dummykey' ,
158
173
aws_secret_access_key : 'dummysecret' ,
165
180
166
181
ENV [ "AWS_STS_REGIONAL_ENDPOINTS" ] = nil
167
182
ENV [ "AWS_DEFAULT_REGION" ] = nil
183
+ ENV [ "AWS_REGION" ] = nil
168
184
ENV [ 'AWS_WEB_IDENTITY_TOKEN_FILE' ] = nil
169
185
170
186
storage = Fog ::Storage . new (
You can’t perform that action at this time.
0 commit comments