Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

Looking for a quick way to pull my account number, I had originally thought of using aws iam get-account-authorization-details --max-items 1 but there are several issues with doing it this way. Is there a way to do this that might not cross-account origins?

1 Answer

0 votes
by (44.4k points)

Secure Token Service subcommand “get-caller-identity” can be used to get the account number, using the following:

aws sts get-caller-identity --output text --query 'Account'

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

Browse Categories

...