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,520 points
1,632 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
• 58,090 points

Related Questions In AWS

0 votes
0 answers

transfer the ownership of Amazon S3 objects from one AWS account to another

I want to transfer the ownership of ...READ MORE

Oct 9, 2019 in AWS by Hannah
• 18,570 points

closed Oct 9, 2019 by Kalgi 622 views
0 votes
1 answer

How to edit files in the AWS S3 bucket from CLI?

Hi@akhtar, According to my knowledge,  you can't edit ...READ MORE

answered Jun 8, 2020 in AWS by MD
• 95,440 points
8,892 views
0 votes
1 answer

how to get the list of aws services i am used in aws my account by using the lambda function

Hi@shalk, You can create a session in your ...READ MORE

answered Sep 24, 2020 in AWS by MD
• 95,440 points
2,199 views
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
• 58,090 points
4,999 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
• 58,090 points
703 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP