public class AwsClientProperties
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CLIENT_CREDENTIAL_PROVIDER_PREFIX
Used by the client.credentials-provider configured value that will be used by
AwsClientFactories.defaultFactory() and other AWS client factory
classes to pass provider-specific properties. |
static java.lang.String |
CLIENT_CREDENTIALS_PROVIDER
Configure the AWS credentials provider used to create AWS clients.
|
static java.lang.String |
CLIENT_REGION
Used by
AwsClientFactories.DefaultAwsClientFactory and also
other client factory classes. |
Constructor and Description |
---|
AwsClientProperties() |
AwsClientProperties(java.util.Map<java.lang.String,java.lang.String> properties) |
Modifier and Type | Method and Description |
---|---|
<T extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder> |
applyClientCredentialConfigurations(T builder)
Configure the credential provider for AWS clients.
|
<T extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder> |
applyClientRegionConfiguration(T builder)
Configure a client AWS region.
|
java.lang.String |
clientRegion() |
software.amazon.awssdk.auth.credentials.AwsCredentialsProvider |
credentialsProvider(java.lang.String accessKeyId,
java.lang.String secretAccessKey,
java.lang.String sessionToken)
Returns a credentials provider instance.
|
void |
setClientRegion(java.lang.String clientRegion) |
public static final java.lang.String CLIENT_CREDENTIALS_PROVIDER
AwsCredentialsProvider
interface is required.
Additionally, the implementation class must also have a create() or create(Map) method implemented, which returns an instance of the class that provides aws credentials provider.
Example: client.credentials-provider=software.amazon.awssdk.auth.credentials.SystemPropertyCredentialsProvider
When set, the default client factory AwsClientFactories.defaultFactory()
and other AWS client factory
classes will use this provider to get AWS credentials provided instead of reading the default
credential chain to get AWS access credentials.
protected static final java.lang.String CLIENT_CREDENTIAL_PROVIDER_PREFIX
AwsClientFactories.defaultFactory()
and other AWS client factory
classes to pass provider-specific properties. Each property consists of a key name and an
associated value.public static final java.lang.String CLIENT_REGION
AwsClientFactories.DefaultAwsClientFactory
and also
other client factory classes. If set, all AWS clients except STS client will use the given
region instead of the default region chain.public AwsClientProperties()
public AwsClientProperties(java.util.Map<java.lang.String,java.lang.String> properties)
public java.lang.String clientRegion()
public void setClientRegion(java.lang.String clientRegion)
public <T extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder> void applyClientRegionConfiguration(T builder)
Sample usage:
S3Client.builder().applyMutation(awsClientProperties::applyClientRegionConfiguration)
public <T extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder> void applyClientCredentialConfigurations(T builder)
Sample usage:
DynamoDbClient.builder().applyMutation(awsClientProperties::applyClientCredentialConfigurations)
public software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialsProvider(java.lang.String accessKeyId, java.lang.String secretAccessKey, java.lang.String sessionToken)
create(Map<String, String>)
static method. If that fails, we fall back to create()
. If credential provider class
wasn't set, we fall back to default credentials provider.accessKeyId
- the AWS access key IDsecretAccessKey
- the AWS secret access keysessionToken
- the AWS session token