Last active
January 25, 2019 18:58
-
-
Save apal21/46b54119bb9bc82775571f4028e6d2d2 to your computer and use it in GitHub Desktop.
Sample code to assume role and generate temporary credentials using a callback
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 AWS = require('aws-sdk'); | |
const sts = new AWS.STS(); | |
sts.assumeRole({ | |
DurationSeconds: 3600, | |
ExternalId: '1234-1234-1234-1234-1234', | |
RoleArn: "Your Role ARN", | |
RoleSessionName: 'abc' | |
}, (err, data) => { | |
if (err) throw err; | |
console.log(data); // successful response | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment