AutoCloseable
, AwsCredentialsProvider
public class DefaultCredentialsProvider extends Object implements AwsCredentialsProvider, AutoCloseable
aws.accessKeyId
and aws.secretKey
AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
Modifier and Type | Class | Description |
---|---|---|
static class |
DefaultCredentialsProvider.Builder |
Configuration that defines the
DefaultCredentialsProvider 's behavior. |
Constructor | Description |
---|---|
DefaultCredentialsProvider() |
Create an instance of the
DefaultCredentialsProvider using the default configuration. |
Modifier and Type | Method | Description |
---|---|---|
static DefaultCredentialsProvider.Builder |
builder() |
Get a builder for defining a
DefaultCredentialsProvider with custom configuration. |
void |
close() |
|
AwsCredentials |
getCredentials() |
Returns
AwsCredentials that can be used to authorize an AWS request. |
public DefaultCredentialsProvider()
DefaultCredentialsProvider
using the default configuration. Configuration can be
specified by creating an instance using the builder()
.public static DefaultCredentialsProvider.Builder builder()
DefaultCredentialsProvider
with custom configuration.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()
close
in interface AutoCloseable
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.