Skip to content

Instantly share code, notes, and snippets.

@rujmah
Created September 15, 2020 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rujmah/66c302d9e28ea00bff2b5954977cb44c to your computer and use it in GitHub Desktop.
Save rujmah/66c302d9e28ea00bff2b5954977cb44c to your computer and use it in GitHub Desktop.
Quick example of getting EC2 instance ids with JS async await
const AWS = require('aws-sdk')
AWS.config.update({region: 'eu-west-1'})
const ec2 = new AWS.EC2()
const inst = ec2.describeInstances().promise()
async function main(){
const result = await inst
console.log('instances', result)
}
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment