A user wants to list the IAM role that is attached to their Amazon EC2 instance. The user has login access to the EC2 instance but does not have IAM permissions. What should a solutions architect do to retrieve this information?
A.
Run the following EC2 command: curl http://169.254.169.254/latest/meta-data/iam/info
B.
Run the following EC2 command: curl http://169.254.169.254/latest/user-data/iam/info
C.
Run the following EC2 command: http://169.254.169.254/latest/dynamic/instance-identity/
D.
Run the following AWS CLI command: aws iam get-instance-profile --instance-profile-name ExampleInstanceProfile
why did you listed all metadata but not the one the question is about? :)
iam/security-credentials/role-name - this is the one we need and yes, it is in metadata. so A is correct definitely
Answer is A.
Details is in url:
https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_iam-ec2.html
GET http://169.254.169.254/latest/meta-data/XXX
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
toto059
Highly Voted 3 years, 8 months agoHeyang
3 years, 7 months agoDS01
3 years, 7 months agoalgreat
Highly Voted 3 years, 8 months agodave0808
3 years, 8 months agonoahsark
3 years, 8 months agopatriktre
3 years, 7 months agoIvanyan
Most Recent 3 years, 3 months agoFF11
3 years, 4 months agoFF11
3 years, 4 months agonazree
3 years, 5 months agojkwek
3 years, 7 months agofreemun05
3 years, 7 months agofreemun05
3 years, 7 months agosyu31svc
3 years, 7 months agoAtanu_M
3 years, 7 months agoYogi
3 years, 7 months agoCCNPWILL
3 years, 8 months agoCountryGent
3 years, 8 months ago