I know multiple regions within a stack can be targ...
# general
s
I know multiple regions within a stack can be targeted by initializing the regional resources so I was trying to do the same for multiple clouds.
s
Hey @salmon-chef-59987! There should be no reason you can’t do this. You will need to set any required config options though.
I’m putting together a little demo of it
OK, I just got this working: here’s the exact steps I took:
Copy code
$ pulumi new -y aws-typescript
$ npm install @pulumi/gcp
$ pulumi config set gcp:project my-project-name
My program looks like this:
Copy code
import * as aws from "@pulumi/aws";
import * as gcp from "@pulumi/gcp";

// Create an AWS resource (S3 Bucket)
const awsBucket = new aws.s3.Bucket("my-bucket");
// Create a GCP resource (Storage Bucket)
const gcpBucket = new gcp.storage.Bucket("my-bucket");

export const bucketNames = [
    awsBucket.bucket,
    gcpBucket.name,
];
Every provider has a “default” instance with which resources register - for simple cases you can get by with that.
We should add this as an example
s
Awesome. Thx @stocky-spoon-28903
I started digging around and saw the gcp.Provider so was almost there.
What does the project setting do?
Can I just pass the option to the provider?
Oh it's the GCP project that I see in the google console.
s
Yes - specifically it’s the ID, not the Display Name
Each provider has some configuration - if you construct instances directly you can pass them into the constructors for the most part
s
👍
Much appreciated
s
I’ve put that example up as a pull request to the main examples repo: https://github.com/pulumi/examples/pull/178/files
👍 1