Class AwsDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>
- Type Parameters:
BuilderT- The type of builder, for chaining.ClientT- The type of client generated by this builder.
- All Implemented Interfaces:
AwsClientBuilder<BuilderT,,ClientT> SdkClientBuilder<BuilderT,,ClientT> Buildable,SdkBuilder<BuilderT,ClientT>
AwsClientBuilder, AwsAsyncClientBuilder and
AwsSyncClientBuilder. This implements all methods required by those interfaces, allowing service-specific builders to
just implement the configuration they wish to add.
By implementing both the sync and async interface's methods, service-specific builders can share code between their sync and async variants without needing one to extend the other. Note: This only defines the methods in the sync and async builder interfaces. It does not implement the interfaces themselves. This is because the sync and async client builder interfaces both require a type-constrained parameter for use in fluent chaining, and a generic type parameter conflict is introduced into the class hierarchy by this interface extending the builder interfaces themselves.
Like all AwsClientBuilders, this class is not thread safe.
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder
SdkDefaultClientBuilder.NonManagedSdkAsyncHttpClient, SdkDefaultClientBuilder.NonManagedSdkHttpClient -
Method Summary
Modifier and TypeMethodDescriptionfinal BuilderTcredentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider) Configure the credentials that should be used to authenticate with AWS.final BuilderTdefaultsMode(DefaultsMode defaultsMode) Sets theDefaultsModethat will be used to determine how certain default configuration options are resolved in the SDK.dualstackEnabled(Boolean dualstackEndpointEnabled) Configure whether the SDK should use the AWS dualstack endpoint.fipsEnabled(Boolean dualstackEndpointEnabled) Configure whether the SDK should use the AWS fips endpoints.final BuilderTConfigure the region with which the SDK should communicate.final voidsetCredentialsProvider(AwsCredentialsProvider credentialsProvider) final voidsetCredentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider) final voidsetDefaultsMode(DefaultsMode defaultsMode) final voidsetDualstackEnabled(Boolean dualstackEndpointEnabled) final voidsetFipsEnabled(Boolean fipsEndpointEnabled) final voidMethods inherited from class software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder
addPlugin, asyncConfiguration, build, endpointOverride, httpClient, httpClient, httpClientBuilder, httpClientBuilder, metricPublishers, overrideConfiguration, overrideConfiguration, plugins, setAsyncConfiguration, setEndpointOverride, setOverrideConfigurationMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.awssdk.awscore.client.builder.AwsClientBuilder
credentialsProviderMethods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, buildMethods inherited from interface software.amazon.awssdk.core.client.builder.SdkClientBuilder
addPlugin, endpointOverride, overrideConfiguration, overrideConfiguration, overrideConfiguration, plugins, putAuthScheme
-
Method Details
-
region
Description copied from interface:AwsClientBuilderConfigure the region with which the SDK should communicate.If this is not specified, the SDK will attempt to identify the endpoint automatically using the following logic:
- Check the 'aws.region' system property for the region.
- Check the 'AWS_REGION' environment variable for the region.
- Check the {user.home}/.aws/credentials and {user.home}/.aws/config files for the region.
- If running in EC2, check the EC2 metadata service for the region.
If the region is not found in any of the locations above, an exception will be thrown at
SdkBuilder.build()time.- Specified by:
regionin interfaceAwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>, ClientT>
-
setRegion
-
dualstackEnabled
Description copied from interface:AwsClientBuilderConfigure whether the SDK should use the AWS dualstack endpoint.If this is not specified, the SDK will attempt to determine whether the dualstack endpoint should be used automatically using the following logic:
- Check the 'aws.useDualstackEndpoint' system property for 'true' or 'false'.
- Check the 'AWS_USE_DUALSTACK_ENDPOINT' environment variable for 'true' or 'false'.
- Check the {user.home}/.aws/credentials and {user.home}/.aws/config files for the 'use_dualstack_endpoint' property set to 'true' or 'false'.
If the setting is not found in any of the locations above, 'false' will be used.
- Specified by:
dualstackEnabledin interfaceAwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>, ClientT>
-
setDualstackEnabled
-
fipsEnabled
Description copied from interface:AwsClientBuilderConfigure whether the SDK should use the AWS fips endpoints.If this is not specified, the SDK will attempt to determine whether the fips endpoint should be used automatically using the following logic:
- Check the 'aws.useFipsEndpoint' system property for 'true' or 'false'.
- Check the 'AWS_USE_FIPS_ENDPOINT' environment variable for 'true' or 'false'.
- Check the {user.home}/.aws/credentials and {user.home}/.aws/config files for the 'use_fips_endpoint' property set to 'true' or 'false'.
If the setting is not found in any of the locations above, 'false' will be used.
- Specified by:
fipsEnabledin interfaceAwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>, ClientT>
-
setFipsEnabled
-
setCredentialsProvider
-
credentialsProvider
public final BuilderT credentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider) Description copied from interface:AwsClientBuilderConfigure the credentials that should be used to authenticate with AWS.The default provider will attempt to identify the credentials automatically using the following checks:
- Java System Properties -
aws.accessKeyIdandaws.secretAccessKey - Environment Variables -
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY - Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
- Credentials delivered through the Amazon EC2 container service if AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable is set and security manager has permission to access the variable.
- Instance profile credentials delivered through the Amazon EC2 metadata service
If the credentials are not found in any of the locations above, an exception will be thrown at
SdkBuilder.build()time.The last of
AwsClientBuilder.credentialsProvider(AwsCredentialsProvider)orAwsClientBuilder.credentialsProvider(IdentityProvider)wins.- Specified by:
credentialsProviderin interfaceAwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>, ClientT>
- Java System Properties -
-
setCredentialsProvider
public final void setCredentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider) -
defaultsMode
Description copied from interface:AwsClientBuilderSets theDefaultsModethat will be used to determine how certain default configuration options are resolved in the SDK.If this is not specified, the SDK will attempt to identify the defaults mode automatically using the following logic:
- Check the "defaults_mode" profile file property.
- Check "aws.defaultsMode" system property.
- Check the "AWS_DEFAULTS_MODE" environment variable.
- Specified by:
defaultsModein interfaceAwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>, ClientT> - Parameters:
defaultsMode- the defaultsMode to use- Returns:
- This object for method chaining.
- See Also:
-
setDefaultsMode
-