AWS Security ChangesHomeSearch

AWS amazondynamodb documentation change

Service: amazondynamodb · 2025-07-04 · Documentation low

File: amazondynamodb/latest/developerguide/V2globaltables.tutorial.md

Summary

Added detailed Java SDK 2.x code examples for Multi-Region Strong Consistency (MRSC) global tables including creation, conversion, verification, testing, and cleanup workflows

Security assessment

The changes focus on operational aspects of MRSC configuration and consistency guarantees rather than addressing security vulnerabilities. While MRSC improves data consistency across regions, this is a reliability feature rather than a security fix. No evidence of patching vulnerabilities or addressing security incidents.

Diff

diff --git a/amazondynamodb/latest/developerguide/V2globaltables.tutorial.md b/amazondynamodb/latest/developerguide/V2globaltables.tutorial.md
index bd54eeef2..b066fb670 100644
--- a//amazondynamodb/latest/developerguide/V2globaltables.tutorial.md
+++ b//amazondynamodb/latest/developerguide/V2globaltables.tutorial.md
@@ -9 +9 @@ Creating a global table configured for MRECCreating a global table configured fo
-This section provides step-by-step instructions for creating DynamoDB global tables with different consistency mode. Choose either Multi-Region Eventual Consistency (MREC) or Multi-Region Strong Consistency (MRSC) modes based on your application's requirements.
+This section provides step-by-step instructions for creating DynamoDB global tables configured for your preferred consistency mode. Choose either Multi-Region Eventual Consistency (MREC) or Multi-Region Strong Consistency (MRSC) modes based on your application's requirements.
@@ -90,0 +91,3 @@ The **Global tables** tab for the **Music** table (and for any other replica tab
+CLI
+    
+
@@ -104,3 +106,0 @@ The following code example shows how to manage DynamoDB global tables with multi
-Bash
-    
-
@@ -254,0 +255,3 @@ Clean up by deleting the table.
+Java
+    
+
@@ -270,3 +272,0 @@ The following code example shows how to create and manage DynamoDB global tables
-Java
-    
-
@@ -716 +716 @@ Here is a sample IAM policy to successfully create a DynamoDB table (`MusicMRSC`
-The following code example shows how to create and manage DynamoDB global tables with Multi-Region Strong Consistency (MRSC).
+The following code examples show how to create and manage DynamoDB global tables with Multi-Region Strong Consistency (MRSC).
@@ -853,0 +854,675 @@ Clean up MRSC global table resources.
+Java
+    
+
+**SDK for Java 2.x**
+    
+
+Create a regional table ready for MRSC conversion using AWS SDK for Java 2.x.
+    
+    
+        public static CreateTableResponse createRegionalTable(final DynamoDbClient dynamoDbClient, final String tableName) {
+    
+            if (dynamoDbClient == null) {
+                throw new IllegalArgumentException("DynamoDB client cannot be null");
+            }
+            if (tableName == null || tableName.trim().isEmpty()) {
+                throw new IllegalArgumentException("Table name cannot be null or empty");
+            }
+    
+            try {
+                LOGGER.info("Creating regional table: " + tableName + " (must be empty for MRSC)");
+    
+                CreateTableRequest createTableRequest = CreateTableRequest.builder()
+                    .tableName(tableName)
+                    .attributeDefinitions(
+                        AttributeDefinition.builder()
+                            .attributeName("Artist")
+                            .attributeType(ScalarAttributeType.S)
+                            .build(),
+                        AttributeDefinition.builder()
+                            .attributeName("SongTitle")
+                            .attributeType(ScalarAttributeType.S)
+                            .build())
+                    .keySchema(
+                        KeySchemaElement.builder()
+                            .attributeName("Artist")
+                            .keyType(KeyType.HASH)
+                            .build(),
+                        KeySchemaElement.builder()
+                            .attributeName("SongTitle")
+                            .keyType(KeyType.RANGE)
+                            .build())
+                    .billingMode(BillingMode.PAY_PER_REQUEST)
+                    .build();
+    
+                CreateTableResponse response = dynamoDbClient.createTable(createTableRequest);
+                LOGGER.info("Regional table creation initiated. Status: "
+                    + response.tableDescription().tableStatus());
+    
+                return response;
+    
+            } catch (DynamoDbException e) {
+                LOGGER.severe("Failed to create regional table: " + tableName + " - " + e.getMessage());
+                throw DynamoDbException.builder()
+                    .message("Failed to create regional table: " + tableName)
+                    .cause(e)
+                    .build();
+            }
+        }
+    
+    
+
+Convert a regional table to MRSC with replicas and witness using AWS SDK for Java 2.x.
+    
+    
+        public static UpdateTableResponse convertToMRSCWithWitness(
+            final DynamoDbClient dynamoDbClient,
+            final String tableName,
+            final Region replicaRegion,
+            final Region witnessRegion) {
+    
+            if (dynamoDbClient == null) {
+                throw new IllegalArgumentException("DynamoDB client cannot be null");
+            }
+            if (tableName == null || tableName.trim().isEmpty()) {
+                throw new IllegalArgumentException("Table name cannot be null or empty");
+            }
+            if (replicaRegion == null) {
+                throw new IllegalArgumentException("Replica region cannot be null");
+            }
+            if (witnessRegion == null) {
+                throw new IllegalArgumentException("Witness region cannot be null");
+            }
+    
+            try {
+                LOGGER.info("Converting table to MRSC with replica in " + replicaRegion.id() + " and witness in "
+                    + witnessRegion.id());
+    
+                // Create replica update using ReplicationGroupUpdate
+                ReplicationGroupUpdate replicaUpdate = ReplicationGroupUpdate.builder()
+                    .create(CreateReplicationGroupMemberAction.builder()
+                        .regionName(replicaRegion.id())
+                        .build())
+                    .build();
+    
+                // Create witness update
+                GlobalTableWitnessGroupUpdate witnessUpdate = GlobalTableWitnessGroupUpdate.builder()
+                    .create(CreateGlobalTableWitnessGroupMemberAction.builder()
+                        .regionName(witnessRegion.id())
+                        .build())
+                    .build();
+    
+                UpdateTableRequest updateTableRequest = UpdateTableRequest.builder()
+                    .tableName(tableName)
+                    .replicaUpdates(List.of(replicaUpdate))
+                    .globalTableWitnessUpdates(List.of(witnessUpdate))
+                    .multiRegionConsistency(MultiRegionConsistency.STRONG)
+                    .build();
+    
+                UpdateTableResponse response = dynamoDbClient.updateTable(updateTableRequest);
+                LOGGER.info("MRSC conversion initiated. Status: "
+                    + response.tableDescription().tableStatus());
+                LOGGER.info("UpdateTableResponse full object: " + response);
+                return response;
+    
+            } catch (DynamoDbException e) {
+                LOGGER.severe("Failed to convert table to MRSC: " + tableName + " - " + e.getMessage());
+                throw DynamoDbException.builder()
+                    .message("Failed to convert table to MRSC: " + tableName)
+                    .cause(e)
+                    .build();
+            }
+        }
+    
+    
+
+Describe an MRSC global table configuration using AWS SDK for Java 2.x.
+    
+    
+        public static DescribeTableResponse describeMRSCTable(final DynamoDbClient dynamoDbClient, final String tableName) {
+    
+            if (dynamoDbClient == null) {
+                throw new IllegalArgumentException("DynamoDB client cannot be null");
+            }
+            if (tableName == null || tableName.trim().isEmpty()) {
+                throw new IllegalArgumentException("Table name cannot be null or empty");
+            }
+    
+            try {
+                LOGGER.info("Describing MRSC global table: " + tableName);
+    
+                DescribeTableRequest request =
+                    DescribeTableRequest.builder().tableName(tableName).build();
+    
+                DescribeTableResponse response = dynamoDbClient.describeTable(request);
+    
+                LOGGER.info("Table status: " + response.table().tableStatus());
+                LOGGER.info("Multi-region consistency: " + response.table().multiRegionConsistency());
+    
+                if (response.table().replicas() != null
+                    && !response.table().replicas().isEmpty()) {
+                    LOGGER.info("Number of replicas: " + response.table().replicas().size());
+                    response.table()
+                        .replicas()
+                        .forEach(replica -> LOGGER.info(
+                            "Replica region: " + replica.regionName() + ", Status: " + replica.replicaStatus()));
+                }
+    
+                if (response.table().globalTableWitnesses() != null
+                    && !response.table().globalTableWitnesses().isEmpty()) {
+                    LOGGER.info("Number of witnesses: "
+                        + response.table().globalTableWitnesses().size());
+                    response.table()
+                        .globalTableWitnesses()
+                        .forEach(witness -> LOGGER.info(
+                            "Witness region: " + witness.regionName() + ", Status: " + witness.witnessStatus()));
+                }
+    
+                return response;
+    
+            } catch (ResourceNotFoundException e) {
+                LOGGER.severe("Table not found: " + tableName + " - " + e.getMessage());
+                throw DynamoDbException.builder()
+                    .message("Table not found: " + tableName)