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

AWSCredentialsProvider implementation that loads credentials from a local metadata service.

Currently supported containers:

The URI path is retrieved from the environment variable "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" or "AWS_CONTAINER_CREDENTIALS_FULL_URI" in the container's environment. Resolving to use relative or absolute path is the role of EC2ContainerCredentialsProviderWrapper.

Full (absolute) URI configuration

For absolute paths, only loopback hosts are allowed when using HTTP, including known endpoints for ECS and EKS. All HTTPS endpoints are allowed.

IPv6 addresses are supported when setting the "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE" environment variable.

Optionally, an authorization token can be included in the "Authorization" header of the request. There are two ways of providing the token, in order of priority:

.

Migrating to the AWS SDK for Java v2

The v2 equivalent of this class isContainerCredentialsProvider

See Migration Guide for more information.