AWS Security ChangesHomeSearch

AWS code-library documentation change

Service: code-library · 2025-06-28 · Documentation low

File: code-library/latest/ug/dynamodb_example_dynamodb_CreateTable_section.md

Summary

Added PowerShell V5 examples for creating DynamoDB tables with primary keys and local secondary indexes, including MREC/MRSC global table references

Security assessment

The changes demonstrate table creation syntax and schema configuration without addressing security controls, encryption, access policies, or vulnerability mitigation. The MREC/MRSC references relate to replication consistency models rather than security features.

Diff

diff --git a/code-library/latest/ug/dynamodb_example_dynamodb_CreateTable_section.md b/code-library/latest/ug/dynamodb_example_dynamodb_CreateTable_section.md
index 2afad7a23..16a290981 100644
--- a//code-library/latest/ug/dynamodb_example_dynamodb_CreateTable_section.md
+++ b//code-library/latest/ug/dynamodb_example_dynamodb_CreateTable_section.md
@@ -22,0 +23,4 @@ Action examples are code excerpts from larger programs and must be run in contex
+  * [Create and manage global tables demonstrating MREC](./dynamodb_example_dynamodb_Scenario_GlobalTableOperations_section.html)
+
+  * [Create and manage MRSC global tables](./dynamodb_example_dynamodb_Scenario_MRSCGlobalTables_section.html)
+
@@ -29 +33 @@ Action examples are code excerpts from larger programs and must be run in contex
-  * [Work with global tables and multi-region replication](./dynamodb_example_dynamodb_Scenario_MultiRegionReplication_section.html)
+  * [Work with global tables and multi-Region replication eventual consistency (MREC)](./dynamodb_example_dynamodb_Scenario_MultiRegionReplication_section.html)
@@ -1684,0 +1689,79 @@ PowerShell
+**Tools for PowerShell V5**
+    
+
+**Example 1: This example creates a table named Thread that has a primary key consisting of 'ForumName' (key type hash) and 'Subject' (key type range). The schema used to construct the table can be piped into each cmdlet as shown or specified using the -Schema parameter.**
+    
+    
+    $schema = New-DDBTableSchema
+    $schema | Add-DDBKeySchema -KeyName "ForumName" -KeyDataType "S"
+    $schema | Add-DDBKeySchema -KeyName "Subject" -KeyType RANGE -KeyDataType "S"
+    $schema | New-DDBTable -TableName "Thread" -ReadCapacity 10 -WriteCapacity 5
+    
+
+**Output:**
+    
+    
+    AttributeDefinitions   : {ForumName, Subject}
+    TableName              : Thread
+    KeySchema              : {ForumName, Subject}
+    TableStatus            : CREATING
+    CreationDateTime       : 10/28/2013 4:39:49 PM
+    ProvisionedThroughput  : Amazon.DynamoDBv2.Model.ProvisionedThroughputDescription
+    TableSizeBytes         : 0
+    ItemCount              : 0
+    LocalSecondaryIndexes  : {}
+
+**Example 2: This example creates a table named Thread that has a primary key consisting of 'ForumName' (key type hash) and 'Subject' (key type range). A local secondary index is also defined. The key of the local secondary index will be set automatically from the primary hash key on the table (ForumName). The schema used to construct the table can be piped into each cmdlet as shown or specified using the -Schema parameter.**
+    
+    
+    $schema = New-DDBTableSchema
+    $schema | Add-DDBKeySchema -KeyName "ForumName" -KeyDataType "S"
+    $schema | Add-DDBKeySchema -KeyName "Subject" -KeyDataType "S"
+    $schema | Add-DDBIndexSchema -IndexName "LastPostIndex" -RangeKeyName "LastPostDateTime" -RangeKeyDataType "S" -ProjectionType "keys_only"
+    $schema | New-DDBTable -TableName "Thread" -ReadCapacity 10 -WriteCapacity 5
+    
+
+**Output:**
+    
+    
+    AttributeDefinitions   : {ForumName, LastPostDateTime, Subject}
+    TableName              : Thread
+    KeySchema              : {ForumName, Subject}
+    TableStatus            : CREATING
+    CreationDateTime       : 10/28/2013 4:39:49 PM
+    ProvisionedThroughput  : Amazon.DynamoDBv2.Model.ProvisionedThroughputDescription
+    TableSizeBytes         : 0
+    ItemCount              : 0
+    LocalSecondaryIndexes  : {LastPostIndex}
+
+**Example 3: This example shows how to use a single pipeline to create a table named Thread that has a primary key consisting of 'ForumName' (key type hash) and 'Subject' (key type range) and a local secondary index. The Add-DDBKeySchema and Add-DDBIndexSchema create a new TableSchema object for you if one is not supplied from the pipeline or the -Schema parameter.**
+    
+    
+    New-DDBTableSchema |
+      Add-DDBKeySchema -KeyName "ForumName" -KeyDataType "S" |
+      Add-DDBKeySchema -KeyName "Subject" -KeyDataType "S" |
+      Add-DDBIndexSchema -IndexName "LastPostIndex" `
+                         -RangeKeyName "LastPostDateTime" `
+                         -RangeKeyDataType "S" `
+                         -ProjectionType "keys_only" |
+      New-DDBTable -TableName "Thread" -ReadCapacity 10 -WriteCapacity 5
+    
+
+**Output:**
+    
+    
+    AttributeDefinitions   : {ForumName, LastPostDateTime, Subject}
+    TableName              : Thread
+    KeySchema              : {ForumName, Subject}
+    TableStatus            : CREATING
+    CreationDateTime       : 10/28/2013 4:39:49 PM
+    ProvisionedThroughput  : Amazon.DynamoDBv2.Model.ProvisionedThroughputDescription
+    TableSizeBytes         : 0
+    ItemCount              : 0
+    LocalSecondaryIndexes  : {LastPostIndex}
+
+  * For API details, see [CreateTable](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. 
+
+
+
+