public final class ContainerCredentialsProvider extends Object
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. If the environment variable is not set, this credentials provider will throw an exception.
Modifier and Type | Class and Description |
---|---|
static class |
ContainerCredentialsProvider.Builder
A builder for creating a custom a
ContainerCredentialsProvider . |
Modifier and Type | Method and Description |
---|---|
static ContainerCredentialsProvider.Builder |
builder()
Create a builder for creating a
ContainerCredentialsProvider . |
void |
close() |
AwsCredentials |
getCredentials()
Returns
AwsCredentials that can be used to authorize an AWS request. |
String |
toString() |
public static ContainerCredentialsProvider.Builder builder()
ContainerCredentialsProvider
.public AwsCredentials getCredentials()
AwsCredentialsProvider
AwsCredentials
that can be used to authorize an AWS request. Each implementation of AWSCredentialsProvider
can chose its own strategy for loading credentials. For example, an implementation might load credentials from an existing
key management system, or load new credentials when credentials are rotated.
If an error occurs during the loading of credentials or credentials could not be found, a runtime exception will be raised.
getCredentials
in interface AwsCredentialsProvider
public void close()
SdkAutoCloseable
close
in interface AutoCloseable
close
in interface SdkAutoCloseable
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.