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,310 points
56 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
• 56,160 points

Related Questions In AWS

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

Login to AWS from AWS Tools for Powershell

If your IAM user account doesn't already ...READ MORE

answered Jul 18, 2018 in AWS by Priyaj
• 56,160 points
45 views
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
• 56,160 points
953 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
• 56,160 points
139 views