AWS Credentials Provider Chain
AWS CLI Credentials Provider chain
The AWS CLI will look in this following order
- Command line options:
--region
,--output
and--profile
- Environment variables:
AWS_ACCESS_KEY_ID
, ... - CLI credentails file:
~/.aws/credentials
- CLI configureation file:
~/.aws/config
- Container credentials (for ECS task)
- Instance profile credentials (for EC2)
AWS SDK Default Provider chain
Wil look for credentials in the following order
- Java system properties:
aws.accessKeyId
andaws.secretKey
- Environment variables:
AWS_ACCESS_KEY_ID
- Default credential profiles file:
~/.aws/credentials
- Amazon ECS container credentials (for ECS)
- Instance profile credentials (EC2)