Package org.apache.iceberg.aws
Class AwsClientProperties
- java.lang.Object
-
- org.apache.iceberg.aws.AwsClientProperties
-
- All Implemented Interfaces:
java.io.Serializable
public class AwsClientProperties extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
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.static java.lang.String
CLIENT_CREDENTIALS_PROVIDER
Configure the AWS credentials provider used to create AWS clients.static java.lang.String
CLIENT_REGION
Used byAwsClientFactories.DefaultAwsClientFactory
and also other client factory classes.static java.lang.String
REFRESH_CREDENTIALS_ENABLED
Controls whether vended credentials should be refreshed or not.static java.lang.String
REFRESH_CREDENTIALS_ENDPOINT
When set, theVendedCredentialsProvider
will be used to fetch and refresh vended credentials from this endpoint.
-
Constructor Summary
Constructors Constructor Description AwsClientProperties()
AwsClientProperties(java.util.Map<java.lang.String,java.lang.String> properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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.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)
-
-
-
Field Detail
-
CLIENT_CREDENTIALS_PROVIDER
public static final java.lang.String 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:
- Constant Field Values
-
CLIENT_CREDENTIAL_PROVIDER_PREFIX
protected static final java.lang.String 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:
- Constant Field Values
-
CLIENT_REGION
public static final java.lang.String 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:
- Constant Field Values
-
REFRESH_CREDENTIALS_ENDPOINT
public static final java.lang.String REFRESH_CREDENTIALS_ENDPOINT
When set, theVendedCredentialsProvider
will be used to fetch and refresh vended credentials from this endpoint.- See Also:
- Constant Field Values
-
REFRESH_CREDENTIALS_ENABLED
public static final java.lang.String REFRESH_CREDENTIALS_ENABLED
Controls whether vended credentials should be refreshed or not. Defaults to true.- See Also:
- Constant Field Values
-
-
Method Detail
-
clientRegion
public java.lang.String clientRegion()
-
setClientRegion
public void setClientRegion(java.lang.String clientRegion)
-
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(java.lang.String accessKeyId, java.lang.String secretAccessKey, java.lang.String sessionToken)
Returns a credentials provider instance. IfrefreshCredentialsEndpoint
is set, an instance ofVendedCredentialsProvider
is returned. 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
-
-