Add web identity provider to S3 connection chain
Signed-off-by: James Letendre <james.letendre@gmail.com>
This commit is contained in:
parent
5750d79181
commit
b65b2bbf55
|
@ -106,22 +106,13 @@ trait S3ConnectionTrait {
|
||||||
CredentialProvider::chain(
|
CredentialProvider::chain(
|
||||||
$this->paramCredentialProvider(),
|
$this->paramCredentialProvider(),
|
||||||
CredentialProvider::env(),
|
CredentialProvider::env(),
|
||||||
CredentialProvider::instanceProfile()
|
CredentialProvider::assumeRoleWithWebIdentityCredentialProvider()
|
||||||
|
!empty(getenv(EcsCredentialProvider::ENV_URI))
|
||||||
|
? CredentialProvider::ecsCredentials()
|
||||||
|
: CredentialProvider::instanceProfile()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// If running in an ECS environment, then also include the ECS task role in the chain
|
|
||||||
if (!empty(getenv(EcsCredentialProvider::ENV_URI))) {
|
|
||||||
$provider = CredentialProvider::memoize(
|
|
||||||
CredentialProvider::chain(
|
|
||||||
$this->paramCredentialProvider(),
|
|
||||||
CredentialProvider::env(),
|
|
||||||
CredentialProvider::ecsCredentials(),
|
|
||||||
CredentialProvider::instanceProfile()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$options = [
|
$options = [
|
||||||
'version' => isset($this->params['version']) ? $this->params['version'] : 'latest',
|
'version' => isset($this->params['version']) ? $this->params['version'] : 'latest',
|
||||||
'credentials' => $provider,
|
'credentials' => $provider,
|
||||||
|
|
Loading…
Reference in New Issue