Quick way to get AWS Account number from the cli tools?

0 votes

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?

Jul 12, 2018 in AWS by bug_seeker
• 15,360 points
93 views

1 answer to this question.

0 votes

Via "Secure Token Service" using the following command.

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

answered Jul 12, 2018 by Priyaj
• 57,300 points

Related Questions In AWS

0 votes
0 answers
+1 vote
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+1 vote
3 answers

How to get ARN for s3 Bucket using aws cli .

An ARN is a non-opaque, constructible identifier, ...READ MORE

answered Aug 16, 2018 in AWS by Priyaj
• 57,300 points
1,670 views
0 votes
1 answer

How to get AWS account/service cost using CloudWatch API?

You can check this link for a ...READ MORE

answered Jul 13, 2018 in AWS by Priyaj
• 57,300 points
158 views