This example provides a basic Terraform project to deploy the playground on Google Cloud as a Cloud Run app.
HCL defines:
- Cloud Run service with the app.
- Simple bucket with shared Go mod and WASM builds cache.
- IAM rules for a cache bucket.
- Terraform or OpenTofu.
- Google Cloud CLI (
gcloud
). - Google Cloud project.
Initialize a Terraform project and prepare a TF variables file:
# Auth on gcloud and init TF project.
# This action should be called only once.
make init
# Create a var file from a template
# and fill it with correct values:
cp example.tfvars prod.tfvars
vim prod.tfvars
See environment variables section in Docker docs.
# Prepare a Terraform plan
make plan
# Apply a plan
make apply
make destroy