跳到正文

How to create an AWS DynamoDB data service with Pulumi ​

Create an AWS DynamoDB resource using @pulumi/aws ​

The @pulumi/aws library enables fine-grained control over the AWS DynamoDB resource meaning it can be coded, deployed, and managed entirely in code.

javascript
const aws = require("@pulumi/aws");

const db = new aws.dynamodb.Table("mytable", {
    attributes: [
        { name: "Id", type: "S" },
    ],
    hashKey: "Id",
    readCapacity: 1,
    writeCapacity: 1,
});

文档内容翻译自 Pulumi 官方文档。