aws4 with assume role.
npm i aws4-with-assume-role
const { makeSigner } = require('aws4-with-assume-role');
makeSigner({
profile: 'my_profile',
region: 'us-west-2',
}, (err, sign) => {
if (err) {
return callback(err);
}
/*
* Make a signed request options with credentials of 'my_profile'.
*/
const requestOptions = sign({
service: 's3',
path: '/',
signQuery: true,
});
});
options.profile
- A name of a profile that gets a credential.
options.region
- A target region to which an request calls.
callback(err, sign)
- A function that is called when a signer function has made or an error occurs.
MIT