AWS CLI Credentials & Config chain
If you use the AWS CLI tool for your operations and application implementation, it’s important to note that the CLI searches for credentials and configuration data in a specific hierarchical order.
Command Line Options
For example: using options like “–profile”, “–region”, “–output” etc…
If the necessary data is not found through command line options, the CLI will check for environmental variables.
Environmental Variables
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN
AWS_DEFAULT_REGION
… and so on. If the data is still not found, the CLI will look for it in the CLI credentials file, which can be found at the following locations:
-
For Linux: ~/.aws/credentials
-
For Windows: C:\Users<user-name>.aws\credentials
Finally, if the data is still not found, the CLI will search for it in the CLI configuration file, which can be found at the following locations:
-
For Linux: ~/.aws/config
-
For Windows: C:\Users.aws\config
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.