Skip to content

Commit

Permalink
Merge pull request #24700 from Imajie/s3-creds
Browse files Browse the repository at this point in the history
Resolves #24699, Support ES2 and ECS instance providers for S3 buckets
  • Loading branch information
rullzer committed Feb 2, 2021
2 parents 5c6d245 + 45a02ee commit 137636b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/private/Files/ObjectStore/S3ConnectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

use Aws\ClientResolver;
use Aws\Credentials\CredentialProvider;
use Aws\Credentials\EcsCredentialProvider;
use Aws\Credentials\Credentials;
use Aws\Exception\CredentialsException;
use Aws\S3\Exception\S3Exception;
Expand Down Expand Up @@ -105,7 +106,10 @@ public function getConnection() {
CredentialProvider::chain(
$this->paramCredentialProvider(),
CredentialProvider::env(),
CredentialProvider::instanceProfile()
CredentialProvider::assumeRoleWithWebIdentityCredentialProvider(),
!empty(getenv(EcsCredentialProvider::ENV_URI))
? CredentialProvider::ecsCredentials()
: CredentialProvider::instanceProfile()
)
);

Expand Down

0 comments on commit 137636b

Please sign in to comment.