Forked from aws-scripting-guy/gist:884ffa9d44bd14f7493a670543284552
Created
August 22, 2018 12:47
-
-
Save IngussNeilands/10e42e24338d09c12c289d70d25fce53 to your computer and use it in GitHub Desktop.
AWS EC2 metadata. Check attached IAM role from EC2 instance. Get temporary credentials.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get IAM Role name from Instance Profile Id | |
curl http://169.254.169.254/latest/meta-data/iam/info | |
# Get credentials | |
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name> | |
# More info | |
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment