Skip to content

The order of DefaultCredentialsProvider #3911

Open
@TingDaoK

Description

@TingDaoK

Describe the issue

The order of DefaultCredentialsProvider, in here makes me confused.

  1. Java System Properties - aws.accessKeyId and aws.secretAccessKey
  1. Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
  2. Web Identity Token credentials from system properties or environment variables
  3. 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

/**
* AWS credentials provider chain that looks for credentials in this order:
* <ol>
* <li>Java System Properties - {@code aws.accessKeyId} and {@code aws.secretAccessKey}</li>
* <li>Environment Variables - {@code AWS_ACCESS_KEY_ID} and {@code AWS_SECRET_ACCESS_KEY}</li>
* <li>Web Identity Token credentials from system properties or environment variables</li>
* <li>Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI</li>
* <li>Credentials delivered through the Amazon EC2 container service if AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" environment
* variable is set and security manager has permission to access the variable,</li>
* <li>Instance profile credentials delivered through the Amazon EC2 metadata service</li>
* </ol>
*
* @see SystemPropertyCredentialsProvider
* @see EnvironmentVariableCredentialsProvider
* @see ProfileCredentialsProvider
* @see WebIdentityTokenFileCredentialsProvider
* @see ContainerCredentialsProvider
* @see InstanceProfileCredentialsProvider
*/

Metadata

Metadata

Assignees

Labels

documentationThis is a problem with documentation.p2This is a standard priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions