The order of DefaultCredentialsProvider
Describe the issue
The order of DefaultCredentialsProvider, in here makes me confused.
- Java System Properties - aws.accessKeyId and aws.secretAccessKey
- Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
- Web Identity Token credentials from system properties or environment variables
- Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI xxx
SystemPropertyCredentialsProvider EnvironmentVariableCredentialsProvider ProfileCredentialsProvider WebIdentityTokenFileCredentialsProvider
I'd assume the link order is the same of the order listed in the documentation. And the documentation is not directly link to the class that have the implementation. So, The ProfileCredentialsProvider should be the 4th in the chain, right?
Links
https://github.com/aws/aws-sdk-java-v2/blob/a1c168a3cb6263b7dbfa6f2c40c95ef159db5bce/core/auth/src/main/java/software/amazon/awssdk/auth/credentials/DefaultCredentialsProvider.java#L29-L47
Good callout, yes, WebIdentityTokenFileCredentialsProvider should be before ProfileCredentialsProvider in the "see also" list.
We welcome PRs :)