Skip to content

Commit

Permalink
Add endpoint URL env variable to fallback options (#1666)
Browse files Browse the repository at this point in the history
* Add endpoint URL env variable to fallback options

* Add changelog for added env variable support

* Update branch alias

* Add unit test for endpoint env variable

* Replace dedicated test with existing provider case
  • Loading branch information
matteokov authored Feb 22, 2024
1 parent 2ea6be2 commit e810d4e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Added

- Support for AWS_ENDPOINT_URL environment variable

## 1.20.1

### Changed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.20-dev"
"dev-master": "1.21-dev"
}
}
}
1 change: 1 addition & 0 deletions src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ final class Configuration
],
[self::OPTION_SHARED_CREDENTIALS_FILE => 'AWS_SHARED_CREDENTIALS_FILE'],
[self::OPTION_SHARED_CONFIG_FILE => 'AWS_CONFIG_FILE'],
[self::OPTION_ENDPOINT => 'AWS_ENDPOINT_URL'],
[
self::OPTION_ROLE_ARN => 'AWS_ROLE_ARN',
self::OPTION_WEB_IDENTITY_TOKEN_FILE => 'AWS_WEB_IDENTITY_TOKEN_FILE',
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public function provideConfiguration(): iterable

yield 'default when env missing' => [[], [], ['profile' => 'default']];
yield 'fallback env' => [[], ['AWS_PROFILE' => 'foo'], ['profile' => 'foo']];
yield 'fallback endpoint env' => [[], ['AWS_ENDPOINT_URL' => 'http://localhost:4566'], ['endpoint' => 'http://localhost:4566']];
yield 'config priority on env' => [['profile' => 'bar'], ['AWS_PROFILE' => 'foo'], ['profile' => 'bar']];

yield 'config with env group' => [['accessKeyId' => 'key'], [], ['accessKeyId' => 'key', 'sessionToken' => null]];
Expand Down

0 comments on commit e810d4e

Please sign in to comment.