Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

I'm creating special-purpose users for Amazon S3 access, for example, to give out to a third-party service. The accounts don't have an email address or password. I was hoping I'd be able to pull the canonical ID of these accounts using the aws command-line tool.

One way I have read about is to create a bucket using their account, look at the ACL for it, and extract the canonical ID from that, then delete the useless bucket and move on.

But for future use, is there an easier way?

1 Answer

0 votes
by (44.4k points)

If you run:

aws iam list-users 

You will get a list of all the IAM users and UserId can be used to identify users. If you are looking for that, you can retrieve it with this command:

aws iam get-user --user-name <iam user name> --query 'User.UserId'

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

Browse Categories

...