terraform-infra-common

module
v0.9.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2025 License: Apache-2.0

README

terraform-infra-common

Static Badge

A repository containing a collection of common infrastructure modules for encapsulating common Cloud Run patterns.

Usage

To use components in this library, you must provide the project in a provider.google resource in your top-level main.tf:

provider "google" {
  project = var.project
}

Resource Labeling Convention

All modules in this repository follow a consistent labeling pattern for GCP cost allocation and resource organization:

locals {
  default_labels = {
    basename(abspath(path.module)) = var.name
    terraform-module               = basename(abspath(path.module))
    product                        = var.product
    team                           = var.team
  }

  merged_labels = merge(local.default_labels, var.labels)
}

This pattern:

  • Enables cost tracking to break down each module by use
  • Maintains consistency across all infrastructure modules
  • Supports team attribution through team labels (with backward compatibility for deprecated squad)
  • Allows custom labels via the labels variable
  • Provides module identification via the terraform-module label
  • Sets both squad and team labels to the same value for resource tagging

The basename(abspath(path.module)) automatically derives the module name (e.g., "gke", "redis", "workqueue") without requiring hardcoded values.

Team vs Squad

All modules support both team and squad variables for backward compatibility:

  • Use team for new code (preferred)
  • squad is deprecated but still supported
  • team takes precedence if both are provided
  • If neither is specified, both labels default to "unknown"

Directories

Path Synopsis
cmd
replayer command
modules
cron/example module
pkg
githubreconciler/changemanager
Package changemanager provides an abstraction for managing GitHub Pull Request lifecycle operations, similar to how the statusmanager handles GitHub Check Runs.
Package changemanager provides an abstraction for managing GitHub Pull Request lifecycle operations, similar to how the statusmanager handles GitHub Check Runs.
githubreconciler/issuemanager
Package issuemanager provides a reconciler-style abstraction for managing GitHub Issues based on desired state.
Package issuemanager provides a reconciler-style abstraction for managing GitHub Issues based on desired state.
githubreconciler/statusmanager
Package statusmanager provides Kubernetes-style status management for GitHub reconcilers using GitHub Check Runs API.
Package statusmanager provides Kubernetes-style status management for GitHub reconcilers using GitHub Check Runs API.
workqueue
Package workqueue contains an interface for a simple key workqueue abstraction.
Package workqueue contains an interface for a simple key workqueue abstraction.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL