diff --git a/lib/get-aws-sts-token.js b/lib/get-aws-sts-token.js index 93f6f24..cc746eb 100644 --- a/lib/get-aws-sts-token.js +++ b/lib/get-aws-sts-token.js @@ -14,13 +14,14 @@ async function getAwsAuthToken( if (obj) return {...obj, servedFromCache: true}; /* access token not found in cache, so generate it using STS */ - const stsClient = new STSClient({ region: awsRegion }); - const params = { - accessKeyId: awsAccessKeyId, - secretAccessKey: awsSecretAccessKey, - DurationSeconds: EXPIRY - }; - const command = new GetSessionTokenCommand(params); + const stsClient = new STSClient({ + region: awsRegion, + credentials: { + accessKeyId: awsAccessKeyId, + secretAccessKey: awsSecretAccessKey, + } + }); + const command = new GetSessionTokenCommand({DurationSeconds: EXPIRY}); const data = await stsClient.send(command); const credentials = {