EC2ContainerCredentialsProviderWrapper (AWS SDK for Java (original) (raw)


public class EC2ContainerCredentialsProviderWrapper
extends Object
implements AWSCredentialsProvider
AWSCredentialsProvider that loads credentials from an Amazon Container (e.g. EC2) Credentials are solved in the following order:

  1. If environment variable "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" is set (typically on EC2) it is used to hit the metadata service at the following endpoint: http://169.254.170.2 (ECS). See ContainerCredentialsProvider for more information.
  2. If environment variable "AWS_CONTAINER_CREDENTIALS_FULL_URI" is set it is used to hit a metadata service at that URI. See ContainerCredentialsProvider for more information.
  3. If neither of the above environment variables are specified credentials are attempted to be loaded from Amazon EC2 Instance Metadata Service using the InstanceProfileCredentialsProvider.