AwsClientBuilder (AWS SDK for Java

Configure the credentials that should be used to authenticate with AWS.

The default provider will attempt to identify the credentials automatically using the following checks:

  1. Java System Properties - aws.accessKeyId and aws.secretAccessKey
  2. Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
  3. Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
  4. 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.
  5. Instance profile credentials delivered through the Amazon EC2 metadata service

If the credentials are not found in any of the locations above, an exception will be thrown at SdkBuilder.build() time.

The last of credentialsProvider(AwsCredentialsProvider) or credentialsProvider(IdentityProvider) wins.

You Might Also Like