dynobase-icon
Dynobase

Error: dynamodb put function not working

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Solution

A DynamoDB put can appear not to run when asynchronous work is not awaited, the wrong client API is used, or the write goes to another table or endpoint. Await the request and inspect its error before returning from the function.

import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, PutCommand } from "@aws-sdk/lib-dynamodb";

const db = DynamoDBDocumentClient.from(new DynamoDBClient({}));

export const handler = async () => {
  const item = { pk: "1", name: "Lakindu" };
  await db.send(new PutCommand({ TableName: "People", Item: item }));
  return { statusCode: 200, body: JSON.stringify(item) };
};

This example assumes People has a String partition key named pk. SDK v2 DocumentClient.put returned a request that needed a callback or .promise(); v3 uses send and needs no .promise(). Keep the SDK client outside the handler for reuse.

A successful PutCommand does not return the new item by default. Verify with a strongly consistent GetItem against the base table and complete key. Check conditions, credentials and Region if it fails. Put replaces an existing item at the same key; use UpdateItem for a partial change.

See put versus update and AWS documentation.

Dynobase is a Professional GUI Client for DynamoDB

Start your 7-day free trial today

Product Features

Download
/
Pricing
/
Member Portal
/
Privacy
/
EULA
/
Twitter
© 2026 Dynobase
+
Still using AWS DynamoDB Console?
Try Dynobase to accelerate your DynamoDB workflow. Start your 7-day free trial today.