AWS: Hot to configure AWS credentials for multiple accounts in Mac OS terminal

Viewed 897

I found way to configure AWS credentials by

aws configure

command. But this is not very comfortable for me since I'm using multiple AWS accounts. Is there any way to make it easy to configure AWS credentials and switch between them?

1 Answers

Yes. You can configure multiple profiles.

The easiest way is to use:

aws configure --profile <name>

You can then use it with:

aws s3 ls --profile <name>

If --profile is not specified, it will use the default profile.

All configuration information is stored in the ~/.aws/credentials and ~/.aws/config files.

See: Named profiles - AWS Command Line Interface

Related