BuilderT - The type of builder, for chaining.ClientT - The type of client generated by this builder.public abstract class AwsDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT> extends SdkDefaultClientBuilder<BuilderT,ClientT> implements AwsClientBuilder<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.
SdkDefaultClientBuilder.NonManagedSdkAsyncHttpClient, SdkDefaultClientBuilder.NonManagedSdkHttpClientclientConfiguration, clientContextParams, overrideConfig| Modifier | Constructor and Description |
|---|---|
protected |
AwsDefaultClientBuilder() |
| Modifier and Type | Method and Description |
|---|---|
BuilderT |
credentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider)
Configure the credentials that should be used to authenticate with AWS.
|
BuilderT |
defaultsMode(DefaultsMode defaultsMode)
Sets the
DefaultsMode that will be used to determine how certain default configuration options are resolved in
the SDK. |
BuilderT |
dualstackEnabled(Boolean dualstackEndpointEnabled)
Configure whether the SDK should use the AWS dualstack endpoint.
|
protected SdkClientConfiguration |
finalizeChildConfiguration(SdkClientConfiguration configuration)
Return a client configuration object, populated with the following chain of priorities.
|
protected SdkClientConfiguration |
finalizeServiceConfiguration(SdkClientConfiguration configuration)
Optionally overridden by child classes to derive service-specific configuration from the default-applied configuration.
|
BuilderT |
fipsEnabled(Boolean dualstackEndpointEnabled)
Configure whether the SDK should use the AWS fips endpoints.
|
protected SdkClientConfiguration |
mergeChildDefaults(SdkClientConfiguration configuration)
Optionally overridden by child implementations to apply implementation-specific default configuration.
|
protected SdkClientConfiguration |
mergeInternalDefaults(SdkClientConfiguration configuration)
Optionally overridden by child classes to define internal default configuration.
|
protected SdkClientConfiguration |
mergeServiceDefaults(SdkClientConfiguration configuration)
Optionally overridden by child classes to define service-specific default configuration.
|
abstract BuilderT |
putAuthScheme(AuthScheme<?> authScheme)
Configure this client with an additional auth scheme, or replace one already on the client.
|
BuilderT |
region(Region region)
Configure the region with which the SDK should communicate.
|
protected abstract String |
serviceEndpointPrefix()
Implemented by child classes to define the endpoint prefix used when communicating with AWS.
|
protected AttributeMap |
serviceHttpConfig()
Optionally overridden by child classes to define service-specific HTTP configuration defaults.
|
protected abstract String |
serviceName()
Implemented by child classes to define the service name used to identify the request in things like metrics.
|
void |
setCredentialsProvider(AwsCredentialsProvider credentialsProvider) |
void |
setCredentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider) |
void |
setDefaultsMode(DefaultsMode defaultsMode) |
void |
setDualstackEnabled(Boolean dualstackEndpointEnabled) |
void |
setFipsEnabled(Boolean fipsEndpointEnabled) |
protected SdkClientConfiguration |
setOverrides(SdkClientConfiguration configuration)
Apply the client override configuration to the provided configuration.
|
void |
setRegion(Region region) |
protected abstract String |
signingName()
Implemented by child classes to define the signing-name that should be used when signing requests when communicating with
AWS.
|
addPlugin, asyncClientConfiguration, asyncConfiguration, build, buildClient, childHttpConfig, childHttpConfig, endpointOverride, httpClient, httpClient, httpClientBuilder, httpClientBuilder, iamEndpoint, invokePlugins, metricPublishers, overrideConfiguration, overrideConfiguration, plugins, setAsyncConfiguration, setEndpointOverride, setOverrideConfiguration, syncClientConfiguration, thisBuilderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcredentialsProvideraddPlugin, endpointOverride, iamEndpoint, overrideConfiguration, overrideConfiguration, overrideConfiguration, pluginsapplyMutation, buildprotected abstract String serviceEndpointPrefix()
For standard services, this should match the "endpointPrefix" field in the AWS model.
protected abstract String signingName()
protected abstract String serviceName()
protected final SdkClientConfiguration mergeChildDefaults(SdkClientConfiguration configuration)
SdkDefaultClientBuildermergeChildDefaults in class SdkDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>protected SdkClientConfiguration mergeServiceDefaults(SdkClientConfiguration configuration)
protected SdkClientConfiguration mergeInternalDefaults(SdkClientConfiguration configuration)
protected final SdkClientConfiguration finalizeChildConfiguration(SdkClientConfiguration configuration)
DefaultsMode finalizeChildConfiguration in class SdkDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>protected final SdkClientConfiguration setOverrides(SdkClientConfiguration configuration)
setOverrides in class SdkDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>protected AttributeMap serviceHttpConfig()
protected SdkClientConfiguration finalizeServiceConfiguration(SdkClientConfiguration configuration)
public final BuilderT region(Region region)
AwsClientBuilderIf this is not specified, the SDK will attempt to identify the endpoint automatically using the following logic:
If the region is not found in any of the locations above, an exception will be thrown at SdkBuilder.build() time.
region in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>public final void setRegion(Region region)
public BuilderT dualstackEnabled(Boolean dualstackEndpointEnabled)
AwsClientBuilderIf this is not specified, the SDK will attempt to determine whether the dualstack endpoint should be used automatically using the following logic:
If the setting is not found in any of the locations above, 'false' will be used.
dualstackEnabled in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>public final void setDualstackEnabled(Boolean dualstackEndpointEnabled)
public BuilderT fipsEnabled(Boolean dualstackEndpointEnabled)
AwsClientBuilderIf this is not specified, the SDK will attempt to determine whether the fips endpoint should be used automatically using the following logic:
If the setting is not found in any of the locations above, 'false' will be used.
fipsEnabled in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>public final void setFipsEnabled(Boolean fipsEndpointEnabled)
public final void setCredentialsProvider(AwsCredentialsProvider credentialsProvider)
public final BuilderT credentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider)
AwsClientBuilderThe default provider will attempt to identify the credentials automatically using the following checks:
aws.accessKeyId and aws.secretAccessKeyAWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEYIf 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) or AwsClientBuilder.credentialsProvider(IdentityProvider)
wins.
credentialsProvider in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>public final void setCredentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider)
public final BuilderT defaultsMode(DefaultsMode defaultsMode)
AwsClientBuilderDefaultsMode that 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:
defaultsMode in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>defaultsMode - the defaultsMode to useDefaultsModepublic final void setDefaultsMode(DefaultsMode defaultsMode)
public abstract BuilderT putAuthScheme(AuthScheme<?> authScheme)
SdkClientBuilderBy default, the SDK will only know about default auth schemes that ship with the service. If you want to modify those existing auth schemes or add a custom one (you select with a custom auth scheme resolver), you can add that new auth scheme with this method.
putAuthScheme in interface SdkClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>Copyright © 2026. All rights reserved.