File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 11const { fromTemporaryCredentials } = require ( '@aws-sdk/credential-providers' ) ;
22const { errorUtils } = require ( 'arsenal' ) ;
3- const { GetCallerIdentityCommand } = require ( '@aws-sdk/client-sts' ) ;
3+ const { STSClient , GetCallerIdentityCommand } = require ( '@aws-sdk/client-sts' ) ;
44
55const { authTypeAssumeRole, authTypeNone } = require ( '../../lib/constants' ) ;
66const VaultClientCache = require ( '../../lib/clients/VaultClientCache' ) ;
@@ -47,8 +47,18 @@ class VaultClientWrapper {
4747 const stsWithCreds = CredentialsManager . resolveExternalFileSync ( sts , this . logger ) ;
4848 const endpoint = `${ sts . transport || 'https' } ://${ sts . host } :${ sts . port } ` ;
4949
50+ const stsClient = new STSClient ( {
51+ endpoint,
52+ region : sts . region || 'us-east-1' ,
53+ credentials : {
54+ accessKeyId : stsWithCreds . accessKey ,
55+ secretAccessKey : stsWithCreds . secretKey ,
56+ } ,
57+ requestHandler : this . stsAgent ,
58+ } ) ;
59+
5060 const getCallerIdentity = new GetCallerIdentityCommand ( { } ) ;
51- this . _tempCredsPromise = stsWithCreds . send ( getCallerIdentity )
61+ this . _tempCredsPromise = stsClient . send ( getCallerIdentity )
5262 . then ( res => {
5363 const roleArn = `arn:aws:iam::${ res . Account } :role/${ roleName } ` ;
5464 const roleSessionName = `${ this . _clientId } ` ;
You can’t perform that action at this time.
0 commit comments