No description
Find a file
2026-03-17 19:35:52 -04:00
modules minor comments additions 2026-03-17 18:27:46 -04:00
.gitignore update .gitignore 2026-02-07 16:26:32 -05:00
infra.png fix dir structure 2026-03-16 20:29:38 +00:00
infra.puml fix dir structure 2026-03-16 20:29:38 +00:00
main.tf minor comments additions 2026-03-17 18:27:46 -04:00
outputs.tf fix dir structure 2026-03-16 20:29:38 +00:00
proxy.sh fix dir structure 2026-03-16 20:29:38 +00:00
README.md readme touchup 2026-03-17 19:35:52 -04:00
terraform.tfvars minor comments additions 2026-03-17 18:27:46 -04:00
variables.tf fix secrets 2026-03-17 14:33:10 -04:00

Code Battleground Infra

This folder contains the Terraform files necessary to deploy the project.

Always use -parallelism=3 in Cloud Shell to avoid TLS rate-limiting errors.

Initial deploy: terraform apply --target=modules.bootstrap -parallelism=3

App deploy: `terraform apply --target=modules.app --parallelism=3"

Eventually we will move to tagging images with Git commit and inject it into terraform such that it's not just using :latest tag, which makes deployments harder.

To run database deployment job use: gcloud run jobs execute migrate-job --region us-central1

Infra notes

  • We are using CloudSQL for persistent storage and Memorystore for fast ephemeral access.
  • CloudRun pulls image automatically, so just redo the apply command to update.
  • CloudRun connects to CloudSQL via a service account that connects to a CloudSQL Auth Proxy.
  • CloudRun connects to Memorystore via a VPC Access Container because Memorystore is only accessible inside the VPC. The connector allows Cloud Run (a serverless service) to join the VPC subnet where Redis is deployed.