Create a table

  1. Start AWS CloudShell at CloudShell Interface

  2. Type the command aws configure

  3. Enter details from the csv file in 2.1.1 Generating Access key:

  • AWS Access Key ID
  • AWS Secret Access Key
  • Default region name
  • Default output format

Create Table Dashboard!

  1. To create a table, use the create-table command. Type command:
aws dynamodb create-table \
    --table-name Music \
    --attribute-definitions \
        AttributeName=Artist,AttributeType=S \
        AttributeName=SongTitle,AttributeType=S \
    --key-schema \
        AttributeName=Artist,KeyType=HASH \
        AttributeName=SongTitle,KeyType=RANGE \
    --provided-throughput \
        ReadCapacityUnits=10,WriteCapacityUnits=5 \
    --table-class STANDARD
  1. Result:
  • Results on AWS CloudShell:
{
    "TableDescription": {
        "AttributeDefinitions": [
            {
                "AttributeName": "Artist",
                "AttributeType": "S"
            },
            {
                "AttributeName": "SongTitle",
                "AttributeType": "S"
            }
        ],
        "TableName": "Music",
        "KeySchema": [
            {
                "AttributeName": "Artist",
                "KeyType": "HASH"
            },
            {
                "AttributeName": "SongTitle",
                "KeyType": "RANGE"
            }
        ],
        "TableStatus": "CREATING",
        "CreationDateTime": "2022-02-08T06:15:18.343000+00:00",
        "ProvisionedThroughput": {
            "NumberOfDecreasesToday": 0,
            "ReadCapacityUnits": 10,
            "WriteCapacityUnits": 5
        },
        "TableSizeBytes": 0,
        "ItemCount": 0,
        "TableArn": "arn:aws:dynamodb:us-east-2:089359461550:table/Music",
        "TableId": "4b2a1e9a-c223-4b07-a536-c4b85a67df96",
        "TableClassSummary": {
            "TableClass": "STANDARD"
        }
    }
}
  • Result on the interface:

Createb Table CloudShell!

  1. Check table status:
  • Type command:
aws dynamodb describe-table --table-name Music | grep TableStatus
  • When DynamoDB finishes creating the table, the value of TableStatus is ACTIVE: "TableStatus": "ACTIVE",