Skip to content

Instantly share code, notes, and snippets.

@mgla
Last active June 7, 2018 12:22
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 mgla/def57688c8c4926def243cfc2b9f54c4 to your computer and use it in GitHub Desktop.
Save mgla/def57688c8c4926def243cfc2b9f54c4 to your computer and use it in GitHub Desktop.
Get AWS IAM instance role
# Get and print IAM instance role
ROLE=$(curl http://169.254.169.254/latest/meta-data/iam/security-credentials/ -s); echo $ROLE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment