AmazonS3Client is the Amazon S3 client class from version 1 of the AWS SDK for Java. In a Spring Boot application it was registered as a bean and used to upload, download, list and delete objects. AWS SDK for Java v1 reached end of support on December 31, 2025, so new code should use S3Client from AWS SDK for Java v2, or Spring Cloud AWS, which wraps it.
This article explains what AmazonS3Client did, and shows the current replacement with working Spring Boot code.
AmazonS3Client implemented the AmazonS3 interface and sent signed HTTP requests to S3. Spring Boot does not auto-configure it, so applications declared a bean (usually through AmazonS3ClientBuilder) and injected the AmazonS3 interface. Its typical responsibilities were:
putObject.getObject.listObjectsV2.deleteObject.generatePresignedUrl.Note that AmazonS3Client itself is a concrete class; the recommended v1 style was always to depend on the AmazonS3 interface and build it with AmazonS3ClientBuilder, not to call the constructors, which were deprecated.
| Topic | SDK v1 AmazonS3Client | SDK v2 S3Client |
|---|---|---|
| Package | com.amazonaws.services.s3 | software.amazon.awssdk.services.s3 |
| Status | End of support since December 31, 2025 | Actively maintained |
| Clients | Mutable, created by builders | Immutable, thread-safe, created by builders |
| Async | Limited | S3AsyncClient with non-blocking I/O |
| Credentials | AWSCredentialsProvider | AwsCredentialsProvider |
Migrating also lets you drop hard-coded keys. The default credentials provider chain finds environment variables, shared profiles, container roles and EC2 or EKS instance roles automatically.
Add the S3 module from the AWS SDK BOM (software.amazon.awssdk:s3), then declare the client:
Never put access keys in source code. Rely on IAM roles in AWS and on a profile or environment variables locally.
getObjectAsBytes loads the whole object into memory. For large files use s3.getObject(request) and stream the response, or return a presigned URL so the browser downloads directly from S3.
Spring Cloud AWS 3.x builds on SDK v2 and auto-configures the client from spring.cloud.aws.* properties. With spring-cloud-aws-starter-s3 on the classpath you can inject S3Template:
Pick the Spring Cloud AWS release that matches your Spring Boot version; the compatibility table is in its documentation.
The SDK v1 as a whole is out of support since December 31, 2025, and the direct AmazonS3Client constructors were deprecated long before that. Use S3Client from SDK v2.
It still compiles, but it no longer receives updates or security fixes. Plan the migration, and note that v1 and v2 can coexist in one project during the transition because their packages differ.
Run LocalStack or MinIO in a container and point the client at it with endpointOverride, or use Testcontainers in integration tests.
No. Use IAM roles for workloads running in AWS and short-lived credentials or SSO profiles for local development.
AmazonS3Client was the S3 client of AWS SDK for Java v1, which is no longer supported. In Spring Boot today, define an S3Client and S3Presigner bean from SDK v2, or use Spring Cloud AWS and S3Template. Resolve credentials through the default provider chain, stream large files, and use presigned URLs for direct browser access.