Package org.apache.iceberg.aws
Class AwsClientProperties
java.lang.Object
org.apache.iceberg.aws.AwsClientProperties
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
Used by the client.credentials-provider configured value that will be used byAwsClientFactories.defaultFactory()
and other AWS client factory classes to pass provider-specific properties.static final String
Configure the AWS credentials provider used to create AWS clients.static final String
Used byAwsClientFactories.DefaultAwsClientFactory
and also other client factory classes. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder>
voidapplyClientCredentialConfigurations
(T builder) Configure the credential provider for AWS clients.<T extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder>
voidapplyClientRegionConfiguration
(T builder) Configure a client AWS region.software.amazon.awssdk.auth.credentials.AwsCredentialsProvider
credentialsProvider
(String accessKeyId, String secretAccessKey, String sessionToken) Returns a credentials provider instance.void
setClientRegion
(String clientRegion)
-
Field Details
-
CLIENT_CREDENTIALS_PROVIDER
Configure the AWS credentials provider used to create AWS clients. A fully qualified concrete class with package that implements theAwsCredentialsProvider
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.- See Also:
-
CLIENT_CREDENTIAL_PROVIDER_PREFIX
Used by the client.credentials-provider configured value that will be used byAwsClientFactories.defaultFactory()
and other AWS client factory classes to pass provider-specific properties. Each property consists of a key name and an associated value.- See Also:
-
CLIENT_REGION
Used byAwsClientFactories.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.- See Also:
-
-
Constructor Details
-
AwsClientProperties
public AwsClientProperties() -
AwsClientProperties
-
-
Method Details
-
clientRegion
-
setClientRegion
-
applyClientRegionConfiguration
public <T extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder> void applyClientRegionConfiguration(T builder) Configure a client AWS region.Sample usage:
S3Client.builder().applyMutation(awsClientProperties::applyClientRegionConfiguration)
-
applyClientCredentialConfigurations
public <T extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder> void applyClientCredentialConfigurations(T builder) Configure the credential provider for AWS clients.Sample usage:
DynamoDbClient.builder().applyMutation(awsClientProperties::applyClientCredentialConfigurations)
-
credentialsProvider
public software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialsProvider(String accessKeyId, String secretAccessKey, String sessionToken) Returns a credentials provider instance. If params were set, we return a new credentials instance. If none of the params are set, we try to dynamically load the provided credentials provider class. Upon loading the class, we try to invokecreate(Map<String, String>)
static method. If that fails, we fall back tocreate()
. If credential provider class wasn't set, we fall back to default credentials provider.- Parameters:
accessKeyId
- the AWS access key IDsecretAccessKey
- the AWS secret access keysessionToken
- the AWS session token- Returns:
- a credentials provider instance
-