0 votes
1 view
in AWS by (19.2k 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.6k 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'

Welcome to Intellipaat Community. Get your technical queries answered by top developers !