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?
You can get the account number from the Secure Token Service subcommand get-caller-identity
using the following:
aws sts get-caller-identity --query Account --output text