mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-03 06:05:04 +09:00
chore: Update dist
This commit is contained in:
Vendored
+9
-1
@@ -169,8 +169,16 @@ async function assumeRole(params) {
|
|||||||
accessKeyId, secretAccessKey, sessionToken, region, endpoint, customUserAgent: USER_AGENT
|
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 = {
|
const assumeRoleRequest = {
|
||||||
RoleArn: roleToAssume,
|
RoleArn: roleArn,
|
||||||
RoleSessionName: roleSessionName,
|
RoleSessionName: roleSessionName,
|
||||||
DurationSeconds: roleDurationSeconds,
|
DurationSeconds: roleDurationSeconds,
|
||||||
Tags: [
|
Tags: [
|
||||||
|
|||||||
Reference in New Issue
Block a user