How to create a DynamoDB using AWS CLI

0 votes
Can someone guide me through the process of creating a DynamoDB table using AWS CLI?
Feb 22, 2019 in AWS by Shuvodip
1,888 views

1 answer to this question.

0 votes

You can create a DynamoDB table using the following command:-

C:\Users\priyj_kumar>aws dynamodb create-table --table-name EmployeeDetail --attribute-definitions AttributeName=EmpID,AttributeType=S AttributeName=PhoneNo,AttributeType=S --key-schema AttributeName=EmpID,KeyType=HASH AttributeName=PhoneNo,KeyType=RANGE --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5

The output that you will get will contain the schema of your table

{
    "TableDescription": {
        "AttributeDefinitions": [
            {
                "AttributeName": "EmpID",
                "AttributeType": "S"
            },
            {
                "AttributeName": "PhoneNo",
                "AttributeType": "S"
            }
        ],
        "TableName": "EmployeeDetail",
        "KeySchema": [
            {
                "AttributeName": "EmpID",
                "KeyType": "HASH"
            },
            {
                "AttributeName": "PhoneNo",
                "KeyType": "RANGE"
            }
        ],
        "TableStatus": "CREATING",
        "CreationDateTime": 1550827368.89,
        "ProvisionedThroughput": {
            "NumberOfDecreasesToday": 0,
            "ReadCapacityUnits": 5,
            "WriteCapacityUnits": 5
        },
        "TableSizeBytes": 0,
        "ItemCount": 0,
        "TableArn": "arn:aws:dynamodb:us-east-1:2453******395:table/EmployeeDetail",
        "TableId": "10688***************bd066b"
    }
}

You can see in your console that your database has been created.

Hope this helps.

answered Feb 22, 2019 by Priyaj
• 58,020 points

Related Questions In AWS

0 votes
1 answer

How to create a subnet inside a VPC using AWS CLI?

To create a subnet inside a VPC ...READ MORE

answered Feb 21, 2019 in AWS by Priyaj
• 58,020 points
711 views
0 votes
1 answer
0 votes
1 answer

How to create a redshift cluster using AWS CLI?

You can create your cluster using AWS ...READ MORE

answered Feb 25, 2019 in AWS by Priyaj
• 58,020 points
1,236 views
0 votes
1 answer
+1 vote
2 answers
0 votes
1 answer

How to create a S3 bucket using AWS CLI?

You can use the following command:- C:\Users\priyj_kumar>aws s3api ...READ MORE

answered Feb 15, 2019 in AWS by Priyaj
• 58,020 points
6,128 views
0 votes
1 answer

How to create a VPC using AWS CLI?

To create an Amazon VPC using AWS ...READ MORE

answered Feb 21, 2019 in AWS by Priyaj
• 58,020 points
1,138 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP