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

Commit

Permalink
improved logging
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresrhys committed Jul 8, 2022
1 parent 420da87 commit 5b8341d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 97 deletions.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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}`);
return sts
.assumeRole({
RoleArn: config.provider.role,
Expand All @@ -25,6 +25,9 @@ const assumeRole = async config => {
secretAccessKey: data.Credentials.SecretAccessKey,
sessionToken: data.Credentials.SessionToken,
});
console.log(
`Assumed AWS role ${config.provider.role} successfully`,
);
})
.catch(err => {
console.error(`Failed to assume ${config.provider.role}`, err);
Expand Down
94 changes: 0 additions & 94 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
},
"peerDependencies": {
"serverless-offline": "^8.8.0",
"serverless": "^3.0.0"
"serverless": "^3.0.0",
"aws-sdk": "^2.875.0"
},
"dependencies": {
"aws-sdk": "^2.875.0",
"execa": "^2.0.3",
"js-yaml": "^3.13.1"
}
Expand Down

0 comments on commit 5b8341d

Please sign in to comment.