Skip to content

PutItem

Source: src/AWS/DynamoDB/PutItem.ts

Runtime binding for dynamodb:PutItem.

Bind this operation to a Table inside a function runtime to get a callable that writes a single item, automatically injecting the table name and granting the host dynamodb:PutItem on the table. Provide the PutItemHttp layer on the Function to satisfy the binding.

// inside the Function's Effect.gen, with Effect.provide(DynamoDB.PutItemHttp)
const putItem = yield* AWS.DynamoDB.PutItem(table);
yield* putItem({
Item: {
pk: { S: "user#123" },
sk: { S: "profile" },
name: { S: "Alice" },
},
});