API to obtain AWS account name beside the organization API?

0

I have securityAudit permission for a given account, I want to programmatically obtain the account alias/name for the target account? Closest I can find information is related to "Organizations" api (describe-account), but that can only be used on the target account itself (and only on root organization/delegated account). Is there any other API that I can call to get this information?

1 Answer
0
aws sts get-caller-identity --query Account --output text
aws iam list-account-aliases 
profile pictureAWS
EXPERT
kentrad
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions