Hosting » AWS » Does AWS CLI cache credentials?

Does AWS CLI cache credentials?

Last updated on September 25, 2022 @ 6:20 pm

AWS CLI credentials can be cached on your local machine. To cache credentials, run the following command:

AWS configure

Enter your AWS credentials and then press Enter. The AWS CLI displays the following message:

Caching credentials could save you some time. Do you want to continue? (y/n)

PRO TIP: AWS CLI will cache your credentials by default. This means that if you have multiple AWS accounts, you may need to clear your credentials cache before switching between them. Additionally, if you are using temporary credentials (such as from an STS assume role), you will need to refresh your cache after the credentials expire.

If you want to cache your credentials, type y and press Enter. The AWS CLI displays the following message:

Caching credentials succeeded.

To cache credentials on a remote machine, use the following command:

AWS configure –remote-cache.

Morgan Bash

Morgan Bash

Technology enthusiast and Co-Founder of Women Coders SF.