Articles → AWS → Create A DynamoDB Table Using AWS CLI

Create A DynamoDB Table Using AWS CLI






Configure CLI





Write Command To Create A Table




  1. Id
  2. ArticleName


aws dynamodb create-table 
--table-name Articles 
--attribute-definitions  
         AttributeName=Id,AttributeType=N         
         AttributeName=ArticleName,AttributeType=S  
--key-schema 
        AttributeName=Id,KeyType=HASH 
        AttributeName=ArticleName,KeyType=RANGE     
--provisioned-throughput 
         ReadCapacityUnits=1,WriteCapacityUnits=1




Attribute NameDescription
--table-name Specifies the name of the table
--attribute-definitionsSpecifies the column name (AttributeName attribute) and their data types (AttributeType attribute).
--key-schemaSpecifies the partition key and the sort key.KeyType = HASH means partition key and KeyType = RANGE means sort key
--provisioned-throughput Specifies the read and write capacity.


Picture showing the execution of aws dynamodb create-table command in AWS cli
Click to Enlarge


Output


Picture showing the table created in dynamodb
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Thursday, February 3, 2022

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250