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: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: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: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.