Skip to content

Commit

Permalink
fix: let the AWS SDK determine the STS regional endpoint (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
clareliguori authored Mar 18, 2020
1 parent a633ed5 commit fc72bd3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const core = require('@actions/core');
const aws = require('aws-sdk');
const assert = require('assert');
const util = require('util');

// The max time that a GitHub action is allowed to run is 6 hours.
// That seems like a reasonable default to use if no role duration is defined.
Expand Down Expand Up @@ -131,10 +130,9 @@ async function exportAccountId(maskAccountId, region) {
}

function getStsClient(region) {
const endpoint = util.format('https://sts.%s.amazonaws.com', region);
return new aws.STS({
region,
endpoint,
stsRegionalEndpoints: 'regional',
customUserAgent: USER_AGENT
});
}
Expand Down

0 comments on commit fc72bd3

Please sign in to comment.