Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 1.14 KB

CLI-DynamoDB.md

File metadata and controls

25 lines (19 loc) · 1.14 KB

Create the Amazon DynamoDB table

Using the AWS CLI to create your table

  1. Install and setup the AWS Command Line Interface.

  2. Run this command to create your table:

    • Creates a table called Favorites in the us-west-2 region.

aws --region us-west-2 dynamodb create-table --table-name Favorites --key-schema AttributeName=UserId,KeyType=HASH --attribute-definitions AttributeName=UserId,AttributeType=S --provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1 ```

Using the AWS Management Console to create your table

  1. Log into the DynamoDB console in the AWS Management Console.
  2. Click Create Table.
  3. Enter Favorites for the table name.
  4. Click Hash for the Primary Key Type
  5. Enter UserId as String for the Hash Attribute Name.
  6. Click Continue
  7. Click Continue on the Add Indexes scren.
  8. Click Continue on the Provisioned Throughput Capacity screen.
  9. Uncheck Use Basic Alarms on the Throughput Alarms screen and then click Continue.
  10. Click Create.