Web server on Google Compute Engine, written in HCL
A simple web server on a Google Compute Engine instance, written in HCL
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-hcl-webservercd pulumi-examples/gcp-hcl-webserverA simple web server running on a Google Compute Engine instance, written in Pulumi HCL. Pulumi installs the HCL language plugin and the Terraform Google provider automatically the first time you run the program.
Prerequisites#
Deploying the example#
-
Create a new stack:
Terminal window pulumi stack init dev -
Set the project and zone to deploy into:
Terminal window export GOOGLE_PROJECT=my-projectexport GOOGLE_ZONE=us-central1-a -
Run
pulumi upto preview and deploy changes. After the preview is shown, you will be prompted to continue:Terminal window pulumi up -
Curl the HTTP server. The instance may take a minute to boot and start serving after the deployment finishes:
Terminal window curl $(pulumi stack output instance_ip)Hello, World!
Cleaning up#
Once you’re finished experimenting, destroy your stack and remove it:
pulumi destroypulumi stack rm