Skip to content

Instantly share code, notes, and snippets.

@john-auld
Created December 23, 2020 14:46
Show Gist options
  • Save john-auld/32930a90410b41b03567df1e39387bc6 to your computer and use it in GitHub Desktop.
Save john-auld/32930a90410b41b03567df1e39387bc6 to your computer and use it in GitHub Desktop.
var AWS = require('/app/node_modules/aws-sdk');
var sts = new AWS.STS();
sts.getCallerIdentity({}, function(err, data) {
if (err) {
console.log("Error", err);
} else {
console.log(JSON.stringify(data));
}
});
@john-auld
Copy link
Author

In the node REPL. Use the following example to check the AWS role.

const AWS = require('aws-sdk');
AWS.config.logger = console;
const sts = new AWS.STS({region: "us-east-1"});
sts.getCallerIdentity({}, function (error,data){console.log(data)});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment