Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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