GCP instance
A GCP Go Pulumi to create an instance
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 gcp-go-instancecd pulumi-examples/gcp-go-instanceCreate a GCP instance using Pulumi and Go.
Prerequisites#
Deploying the example#
-
Create a new stack:
Terminal window pulumi stack init dev -
Configure the project:
Terminal window pulumi config set gcp:project YOURGOOGLECLOUDPROJECTpulumi config set gcp:zone us-central1-a -
Install dependencies:
Terminal window go mod download -
Run
pulumi upto preview and deploy changes:Terminal window pulumi upUpdating (dev):Type Name Status+ pulumi:pulumi:Stack gcp-instance created+ └─ gcp:compute:Instance instance createdOutputs:instanceName: "instance-6beb431"Resources:+ 2 createdDuration: 23s
Cleaning up#
Once you’re finished experimenting, destroy your stack and remove it:
pulumi destroypulumi stack rm