chore: Update dist

This commit is contained in:
GitHub Actions 2020-03-04 22:25:30 +00:00
commit 3c4f95f73f

10
dist/index.js vendored
View file

@ -169,8 +169,16 @@ async function assumeRole(params) {
accessKeyId, secretAccessKey, sessionToken, region, endpoint, customUserAgent: USER_AGENT
});
let roleArn = roleToAssume;
if (!roleArn.startsWith('arn:aws')) {
const identity = await sts.getCallerIdentity().promise();
const accountId = identity.Account;
// Supports only 'aws' partition. Customers in other partitions ('aws-cn') will need to provide full ARN
roleArn = `arn:aws:iam::${accountId}:role/${roleArn}`;
}
const assumeRoleRequest = {
RoleArn: roleToAssume,
RoleArn: roleArn,
RoleSessionName: roleSessionName,
DurationSeconds: roleDurationSeconds,
Tags: [