add_item
Add a new item to a DynamoDB table or replace an existing one by primary key. Use a condition expression to prevent overwrites.
Instructions
Add (put) a single item to a DynamoDB table.
Creates a new item or replaces an existing item with the same primary key. Use condition_expression='attribute_not_exists(PK)' to prevent overwrites.
When to use:
To create a new item in a table
To replace an entire existing item
When NOT to use:
To update specific attributes (use update_item instead)
To add many items at once (use bulk_add_items instead)
Returns: JSON confirmation with the item's primary key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |