Skip to content

Files

Latest commit

11046de · Aug 12, 2024

History

History

gcloud

Google Cloud Run Deployment

Overview

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.

Prerequisites

Deployment

First-time setup

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

App Configuration

See environment variables section in Docker docs.

Deploying changes

# Prepare a Terraform plan
make plan

# Apply a plan
make apply

Destroying a deployment

make destroy