Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
support new format
Browse files Browse the repository at this point in the history
  • Loading branch information
benholmes-ft committed Aug 19, 2022
1 parent 5b8341d commit 8c5bc31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const assumeRole = async config => {
const AWS = require('aws-sdk'); // eslint-disable-line global-require
AWS.config.region = config.provider.region;
const sts = new AWS.STS({ apiVersion: '2011-06-15' });
console.log(`Attempting to assume AWS role ${config.provider.role}`);
console.log(`Attempting to assume AWS role ${config.provider.iam.role}`);
return sts
.assumeRole({
RoleArn: config.provider.role,
RoleArn: config.provider.iam.role,
RoleSessionName: `${config.provider.service}-${
process.env.USER || 'unknown'
}-${Date.now()}`,
Expand All @@ -26,11 +26,11 @@ const assumeRole = async config => {
sessionToken: data.Credentials.SessionToken,
});
console.log(
`Assumed AWS role ${config.provider.role} successfully`,
`Assumed AWS role ${config.provider.iam.role} successfully`,
);
})
.catch(err => {
console.error(`Failed to assume ${config.provider.role}`, err);
console.error(`Failed to assume ${config.provider.iam.role}`, err);
throw err;
});
};
Expand Down

0 comments on commit 8c5bc31

Please sign in to comment.