跳到正文

Review the New Project ​

Let's review some of the generated project files:

  • index.ts is the Pulumi program that defines your stack resources. Let's examine it.
typescript
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

// Create a GCP resource (Storage Bucket)
const bucket = new gcp.storage.Bucket("my-bucket");

// Export the DNS name of the bucket
export const bucketName = bucket.url;

This Pulumi program creates a new storage bucket and exports the DNS name of the bucket.

typescript
export const bucketName = bucket.url;

Next, you'll deploy your stack, which will provision your storage bucket.

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