DynamoDB - with AWS SDK
You wrote this code to put an item into DynamoDB using the SDK, but it throws an error:
What is the likely cause of the error?
const { DynamoDBClient, PutItemCommand } = require("@aws-sdk/client-dynamodb");
const client = new DynamoDBClient({ region: "us-east-1" });
async function addItem() {
const command = new PutItemCommand({
TableName: "Products",
Item: {
ProductId: "001",
Name: "Book"
}
});
await client.send(command);
}
addItem();What is the likely cause of the error?
