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 in AWS by Shuvodip
29 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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 by Priyaj
• 56,140 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
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 in AWS by Priyaj
• 56,140 points
82 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 in AWS by Priyaj
• 56,140 points
51 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.