How chainguard-dev/terraform-infra-common works
Project type and purpose
• This repository is a “terraform-infra-common” library: a curated collection of reusable Terraform modules that encapsulate common Google Cloud Run and event-driven patterns, plus accompanying Go-based helper programs (under cmd/ and modules/*/cmd/) and shared libraries (pkg/).
• Its main goal is to provide building blocks for infra-as-code: Cloud Run services (trampolines, brokers, recorders), Pub/Sub triggers, BigQuery sinks, Cloud SQL, dashboards, GitHub bots, networking, etc.
File structure
• Top level
• cmd/replayer – a Go CLI
• pkg/ – shared Go libraries (http metrics, pubsub, workqueue, profilers, etc.)
• modules/ – ~30 self-contained Terraform modules. Some modules include Go code under modules/*/cmd/ which is built into container images and deployed by the Terraform module.
• .github/workflows – CI pipelines for Go tests, Terraform validation, docs generation.
• hack/update-docs.sh, README.md, go.mod – build and documentation orchestration.
README
• Confirms: “A repository containing a collection of common infrastructure modules for encapsulating common Cloud Run patterns.”
• Usage: top-level Terraform provides a google provider, then consumers import these modules from Terraform Registry.