Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Last active June 24, 2018 03:46
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 tkuchiki/7479beab3e8f0a0699d8399e2be9338f to your computer and use it in GitHub Desktop.
Save tkuchiki/7479beab3e8f0a0699d8399e2be9338f to your computer and use it in GitHub Desktop.
get ec2 security credentials
#!/bin/sh
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html
base_url="http://169.254.169.254/latest/meta-data/iam/security-credentials"
iam_role=`curl -s $base_url/`
curl -s "$base_url/$iam_role"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment