Skip to main content
Cloud Adapter preserves the AWS service model at the application boundary. Your Java code keeps using AWS request and response types; the client factory selects the adapter endpoint. This example uses AWS SDK for Java 2.x and S3. Check S3 service coverage for the target environment and operations your application uses.

Choose how to set the endpoint

Set it for the process

The AWS-standard S3 environment variable applies to every S3 client created by a supported SDK in this process:
Build the client normally and omit endpointOverride:

Set it on one client

Keep endpoint selection in one factory rather than scattering it through business logic.
endpointOverride changes where the AWS request is sent. It does not change the service model, add unsupported operations, or provide credentials to the target service. Backend credentials stay in the service adapter configuration. An explicit client override takes precedence over AWS_ENDPOINT_URL_S3. Choose one approach for a client factory so configuration remains easy to audit. For SDK 1.x, use AmazonS3ClientBuilder with an endpoint configuration and path-style access. Do not mix 1.x and 2.x configuration examples in the same client factory.

Verify a lifecycle

Use a unique key and a small payload:
Verify the object in the target service after putObject, not only through the adapter. That catches name, region, metadata, and identity mistakes that an origin-shaped response alone may hide.

Preserve failure evidence

Catch service and transport failures separately:
Do not automatically retry a timed-out mutation until you have checked target state and the operation’s idempotency. Retain the SDK request ID and Cloud Adapter diagnostic headers in structured logs, while excluding credentials and payload bodies.

Production client checklist

  • Make endpoint, origin region, and credential provider explicit.
  • Bound connection, request, and retry timeouts for the target path.
  • Reuse the client; do not create one per request.
  • Test the exact paginator, waiter, conditional request, and multipart features the application uses.
  • Keep AWS-origin credentials separate from the adapter’s target-cloud identity.
  • Run an expected not-found or validation error to verify error translation.
For a deeper failure, preserve the SDK request ID and follow Debugging Your Adapters.