aws-iamrole-helper
v1.0.2
Published
This helps you deal with IAM Roles easily and have a continued credentialed session without resorting to custom code.
Downloads
2
Maintainers
Readme
AWS IAM Role Helper
This project builds off of the AWS SDK and makes it easier for you to instantiate IAM Role Sessions for your SDK Needs. Once you have instantiated your role session using a simple command, you can go ahead and use the SDK to query for your resources.
Instantiate Your Role Session:
const AWS = require('AWS-sdk') // Your top-level import of AWS-sdk
const AWSRoleHelper = require('aws-iamrole-helper')
AWSRoleHelper.assumeRole(AWS, your_role_ARN)
.then(() => {
// do your work here to query the SDK
})
Assume multiple roles at the same time. AWSRoleHelper takes care of managing all the sessions behind the scenes.
const roleARNblue = 'Role ARN for some resource set blue'
const roleARNred = 'Role ARN for some resource set red'
AWSRoleHelper.assumeRole(AWS, roleARNBlue)
.then(() => {
// do something with BLUE resources
})
AWSRoleHelper.assumeRole(AWS, roleARNRed)
.then(() => {
// do something with RED resources
})