跳到正文

How to use Pulumi with AWS ​

Multi-cloud development with @pulumi\cloud ​

For a higher-level abstraction, and greater portability, the @pulumi\cloud-aws library provides a set of classes that enable productive development for any cloud. When instantiated for AWS, code is adapted to use the available services in AWS, and the supporting services necessary to deploy them (e.g. IAM roles).

javascript
var cloud = require("@pulumi/cloud-aws");

// Create RestAPI and Lambda Functions
const myLambda = new cloud.API("nameLambda");

// Create an S3 Bucket
const myBucket = new cloud.Bucket("nameBucket");

// Create container infrastructure using AWS Fargate
const myContainer = new cloud.Task("nameContainer");

// Create container infrastructure using AWS ECS
const myService = new cloud.Service("nameService");

// Create DynamoDB table
const myDatabase = new cloud.Table("nameTable");

// Create AWS Cloudwatch event rule
const myTimer = new cloud.Timer("nameTimer";)

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