AWS Security ChangesHomeSearch

AWS AmazonS3 documentation change

Service: AmazonS3 · 2025-08-22 · Documentation low

File: AmazonS3/latest/userguide/transfer-acceleration-examples.md

Summary

Updated Java SDK code examples for Transfer Acceleration to use AWS SDK for Java 2.x syntax and client patterns. Changed imports, client initialization, request builders, and error handling to match modern SDK conventions.

Security assessment

The changes are purely technical updates to align with newer SDK versions and coding patterns. No security vulnerabilities, mitigations, or security-specific features are mentioned. The update focuses on syntax modernization rather than security aspects.

Diff

diff --git a/AmazonS3/latest/userguide/transfer-acceleration-examples.md b/AmazonS3/latest/userguide/transfer-acceleration-examples.md
index 5253602c0..101ba286c 100644
--- a//AmazonS3/latest/userguide/transfer-acceleration-examples.md
+++ b//AmazonS3/latest/userguide/transfer-acceleration-examples.md
@@ -98 +98 @@ Java
-The following example shows how to use an accelerate endpoint to upload an object to Amazon S3. The example does the following:
+To use an accelerate endpoint to upload an object to Amazon S3 with the AWS SDK for Java, you can:
@@ -100 +100 @@ The following example shows how to use an accelerate endpoint to upload an objec
-  * Creates an `AmazonS3Client` that is configured to use accelerate endpoints. All buckets that the client accesses must have Transfer Acceleration enabled.
+  * Create an S3Client that is configured to use accelerate endpoints. All buckets that the client accesses must have Transfer Acceleration enabled.
@@ -102 +102 @@ The following example shows how to use an accelerate endpoint to upload an objec
-  * Enables Transfer Acceleration on a specified bucket. This step is necessary only if the bucket you specify doesn't already have Transfer Acceleration enabled.
+  * Enable Transfer Acceleration on a specified bucket. This step is necessary only if the bucket you specify doesn't already have Transfer Acceleration enabled.
@@ -104 +104 @@ The following example shows how to use an accelerate endpoint to upload an objec
-  * Verifies that transfer acceleration is enabled for the specified bucket.
+  * Verify that transfer acceleration is enabled for the specified bucket.
@@ -106 +106 @@ The following example shows how to use an accelerate endpoint to upload an objec
-  * Uploads a new object to the specified bucket using the bucket's accelerate endpoint.
+  * Upload a new object to the specified bucket using the bucket's accelerate endpoint.
@@ -111 +111 @@ The following example shows how to use an accelerate endpoint to upload an objec
-For more information about using Transfer Acceleration, see [Getting started with Amazon S3 Transfer Acceleration](./transfer-acceleration-getting-started.html). For instructions on creating and testing a working sample, see [Getting Started](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/getting-started.html) in the AWS SDK for Java Developer Guide.
+For more information about using Transfer Acceleration, see [Getting started with Amazon S3 Transfer Acceleration](./transfer-acceleration-getting-started.html).
@@ -112,0 +113 @@ For more information about using Transfer Acceleration, see [Getting started wit
+The following code example shows how to configure Transfer Acceleration with the AWS SDK for Java.
@@ -114,10 +115,12 @@ For more information about using Transfer Acceleration, see [Getting started wit
-    import com.amazonaws.AmazonServiceException;
-    import com.amazonaws.SdkClientException;
-    import com.amazonaws.auth.profile.ProfileCredentialsProvider;
-    import com.amazonaws.regions.Regions;
-    import com.amazonaws.services.s3.AmazonS3;
-    import com.amazonaws.services.s3.AmazonS3ClientBuilder;
-    import com.amazonaws.services.s3.model.BucketAccelerateConfiguration;
-    import com.amazonaws.services.s3.model.BucketAccelerateStatus;
-    import com.amazonaws.services.s3.model.GetBucketAccelerateConfigurationRequest;
-    import com.amazonaws.services.s3.model.SetBucketAccelerateConfigurationRequest;
+    
+    import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
+    import software.amazon.awssdk.core.sync.RequestBody;
+    import software.amazon.awssdk.regions.Region;
+    import software.amazon.awssdk.services.s3.S3Client;
+    import software.amazon.awssdk.services.s3.model.BucketAccelerateStatus;
+    import software.amazon.awssdk.services.s3.model.GetBucketAccelerateConfigurationRequest;
+    import software.amazon.awssdk.services.s3.model.PutBucketAccelerateConfigurationRequest;
+    import software.amazon.awssdk.services.s3.model.PutObjectRequest;
+    import software.amazon.awssdk.services.s3.model.AccelerateConfiguration;
+    import software.amazon.awssdk.services.s3.model.S3Exception;
+    import software.amazon.awssdk.core.exception.SdkClientException;
@@ -127,3 +130,3 @@ For more information about using Transfer Acceleration, see [Getting started wit
-            Regions clientRegion = Regions.DEFAULT_REGION;
-            String bucketName = "*** Bucket name ***";
-            String keyName = "*** Key name ***";
+            Region clientRegion = Region.US_EAST_1;
+            String bucketName = "*** Provide bucket name ***";
+            String keyName = "*** Provide key name ***";
@@ -133,4 +136,4 @@ For more information about using Transfer Acceleration, see [Getting started wit
-                AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
-                        .withRegion(clientRegion)
-                        .withCredentials(new ProfileCredentialsProvider())
-                        .enableAccelerateMode()
+                S3Client s3Client = S3Client.builder()
+                        .region(clientRegion)
+                        .credentialsProvider(ProfileCredentialsProvider.create())
+                        .accelerate(true)
@@ -140,4 +143,7 @@ For more information about using Transfer Acceleration, see [Getting started wit
-                s3Client.setBucketAccelerateConfiguration(
-                        new SetBucketAccelerateConfigurationRequest(bucketName,
-                                new BucketAccelerateConfiguration(
-                                        BucketAccelerateStatus.Enabled)));
+                s3Client.putBucketAccelerateConfiguration(
+                        PutBucketAccelerateConfigurationRequest.builder()
+                                .bucket(bucketName)
+                                .accelerateConfiguration(AccelerateConfiguration.builder()
+                                        .status(BucketAccelerateStatus.ENABLED)
+                                        .build())
+                                .build());
@@ -147,2 +153,4 @@ For more information about using Transfer Acceleration, see [Getting started wit
-                        new GetBucketAccelerateConfigurationRequest(bucketName))
-                        .getStatus();
+                        GetBucketAccelerateConfigurationRequest.builder()
+                                .bucket(bucketName)
+                                .build())
+                        .status().toString();
@@ -152 +160,5 @@ For more information about using Transfer Acceleration, see [Getting started wit
-                s3Client.putObject(bucketName, keyName, "Test object for transfer acceleration");
+                s3Client.putObject(PutObjectRequest.builder()
+                                .bucket(bucketName)
+                                .key(keyName)
+                                .build(),
+                        RequestBody.fromString("Test object for transfer acceleration"));
@@ -154 +166 @@ For more information about using Transfer Acceleration, see [Getting started wit
-            } catch (AmazonServiceException e) {
+            } catch (S3Exception e) {