AWS and GCP resources
Example showing a single program deploying to both AWS and GCP
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set multicloud-ts-bucketscd pulumi-examples/multicloud-ts-bucketsThis example uses a single Pulumi program to provision resources in both AWS and GCP. It was
prepared by starting with the aws-typescript template, and then installing the @pulumi/gcp
package from NPM.
Prerequisites#
Deploying the example#
-
Install dependencies:
Terminal window npm install -
Create a new stack:
Terminal window pulumi stack init multicloud-aws-gcp -
Configure the Pulumi program with the AWS region in which to deploy, and the GCP project ID:
Terminal window pulumi config set aws:region us-east-1pulumi config set gcp:project my-project-id -
Run the program with
pulumi up, with ambient AWS and GCP credentials available. The preview shows resources will be created in both clouds. Confirm the update, and resources are created in each cloud. The outputs show the name of the AWS and GCP buckets respectively.Terminal window pulumi upUpdating (multicloud-ts-buckets-dev):Type Name Status+ pulumi:pulumi:Stack multicloud-ts-buckets-multicloud-ts-buckets-dev created+ ├─ gcp:storage:Bucket my-bucket created+ └─ aws:s3:Bucket my-bucket createdOutputs:bucketNames: [[0]: "my-bucket-c819937"[1]: "my-bucket-f722eb9"]Resources:+ 3 createdDuration: 21.713128552s
Cleaning up#
Once you’re finished experimenting, destroy your stack and remove it to avoid incurring any additional cost:
pulumi destroypulumi stack rm