[AWS CLI] Add multiple items to a DynamoDB table in one batch

Created on November 28, 2026

You can use aws dynamodb batch-write-item to add multiple items to a DynamoDB table in one batch. A batch can contain up to 25 items to add. See the official documentation for details on the limits.

Example

First, create a file named request-items.json with the contents below. DummyTable is the name of the target table. Include one PutRequest object for each item you want to add.

{
  "DummyTable": [
    {
      "PutRequest": {
        "Item": {
          "id": {"S": "1"}, "name": {"S": "Tom"}
        }
      }
    },
    {
      "PutRequest": {
        "Item": {
          "id": {"S": "2"}, "name": {"S": "Bob"}
        }
      }
    }
  ]
}

Run the command with the file path as the value of --request-items.

aws dynamodb batch-write-item --request-items file://request-items.json

The command produces the following output.

{
    "UnprocessedItems": {}
}
AWS CLI DynamoDB