mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-04 06:15:07 +09:00
fix: let the AWS SDK determine the STS regional endpoint (#48)
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
const aws = require('aws-sdk');
|
const aws = require('aws-sdk');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const util = require('util');
|
|
||||||
|
|
||||||
// The max time that a GitHub action is allowed to run is 6 hours.
|
// 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.
|
// That seems like a reasonable default to use if no role duration is defined.
|
||||||
@@ -131,10 +130,9 @@ async function exportAccountId(maskAccountId, region) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getStsClient(region) {
|
function getStsClient(region) {
|
||||||
const endpoint = util.format('https://sts.%s.amazonaws.com', region);
|
|
||||||
return new aws.STS({
|
return new aws.STS({
|
||||||
region,
|
region,
|
||||||
endpoint,
|
stsRegionalEndpoints: 'regional',
|
||||||
customUserAgent: USER_AGENT
|
customUserAgent: USER_AGENT
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user