A repository containing a collection of common infrastructure modules for encapsulating common Cloud Run patterns.
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
}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
labelsvariable - Provides module identification via the
terraform-modulelabel - 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.
All modules support both team and squad variables for backward compatibility:
- Use
teamfor new code (preferred) squadis deprecated but still supportedteamtakes precedence if both are provided- If neither is specified, both labels default to "unknown"