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


public class InstanceProfileCredentialsProvider
extends Object
implements AWSCredentialsProvider, Closeable
Credentials provider implementation that loads credentials from the Amazon EC2 Instance Metadata Service (IMDS).
When using InstanceProfileCredentialsProvider with asynchronous refreshing it isstrongly recommended to explicitly call close() to release the async thread.
The provider is configured with the default Instance Metadata Service endpoint. You can override the endpoint value by setting a valid URI as the value of the

  1. com.amazonaws.sdk.ec2MetadataServiceEndpointOverride system property or
  2. AWS_EC2_METADATA_SERVICE_ENDPOINT environment value