Example of a minimal VPC abstraction across AWS, Azure, and GCP.
-
Open a terminal,
git clone
this repo, and change directory to whereindex.ts
resides. -
Change the import at the top of
index.ts
to change cloud provider.import {MyVpc} from "./vpc-aws"; // import {MyVpc} from "./vpc-azure"; // import {MyVpc} from "./vpc-gcp";
-
Run the appropriate AWS or GCP command below if you chose AWS or GCP as your cloud provider.
pulumi config set aws:region <region> pulumi config set gcp:region <region>
-
Run
pulumi up
.$ pulumi up Previewing update (dev): Type Name Plan + pulumi:pulumi:Stack ts-vpc-abstraction-dev create + ├─ custom:aws:Vpc main create + │ └─ aws:ec2:Vpc main create + ├─ aws:ec2:Subnet main-1 create + └─ aws:ec2:Subnet main-0 create Resources: + 5 to create Do you want to perform this update? yes Updating (dev): Type Name Status + pulumi:pulumi:Stack ts-vpc-abstraction-dev created + ├─ custom:aws:Vpc main created + │ └─ aws:ec2:Vpc main created + ├─ aws:ec2:Subnet main-0 created + └─ aws:ec2:Subnet main-1 created Outputs: subnetIds: [ [0]: "subnet-03019da431112da21" [1]: "subnet-0e128ddf1cd4889a8" ] vpcId : "vpc-0d7d822c4753ed3de" Resources: + 5 created Duration: 14s Permalink: https://app.pulumi.com/clstokes/ts-vpc-abstraction/dev/updates/15
-
Run
pulumi destroy
to clean up resources.