[AWS CLI] Put an item in a DynamoDB table

Created on November 29, 2026

You can use aws dynamodb put-item to write an item to a DynamoDB table. The example writes an item with the string attributes id set to 1 and name set to Tom. It assumes that DummyTable already exists and uses id as its string partition key with no sort key.

aws dynamodb put-item \
    --table-name DummyTable \
    --item '{"id": {"S": "1"}, "name": {"S": "Tom"}}'

If an item with the same primary key already exists, put-item replaces it.

AWS CLI DynamoDB