-
-
Save madan712/2172bbb03865ffe57b7a90eba3d97e00 to your computer and use it in GitHub Desktop.
AWS SDK javascript v3 assume role
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assumeRole = async (email) => { | |
console.log(`Assuming role`); | |
const param = { | |
RoleArn: QUICKSIGHT_ROLE_ARN, | |
RoleSessionName: email, // An unique identifier like email/username etc | |
DurationSeconds: 900, | |
}; | |
const command = new AssumeRoleCommand(param); | |
const response = await stsClient.send(command); | |
console.log(JSON.stringify(response)); | |
return getQuickSightClient(response.Credentials); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment