Working with multiple AWS accounts

Using multiple AWS accounts under an Organization umbrella can be useful even at a personal level, for learning AWS features and self-training, it helps keep various projects partitioned. However, working with multiple accounts at a time can get complex, and on more than one occasion I’ve lost track of which account I’m actually working with.

If you’re working with api keypairs and don’t know which account the keypair is for, the following aws cli command is useful:

aws sts get-caller-identity

It shows you the following info:

{
  "UserId" : ... key id ...,
  "Account" : ... account id ...,
  "Arn" : ... the IAM ARN for the current userid

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.