terraform-infra-common

module
v1.51.3 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0

README

terraform-infra-common

Static Badge

A collection of common infrastructure modules that encapsulate Cloud Run and GCP patterns.

Modules

See MODULES.md for a summary of all available modules.

Go helpers

The httpmetrics package provides HTTP instrumentation and opt-in serving-revision metadata for HTTP and gRPC services.

The memusage package logs Linux process and container memory high-water marks, including peaks between monitoring samples.

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 labels

Many modules add a terraform-module label and a label named after the module. Modules differ in which other labels they apply and whether they accept a labels map. Check the module's variables and resources before relying on a specific label.

When a module requires a team input, provide the owning team. Some modules also add a squad label with that value for compatibility. The product input and its default also vary by module.

Submitting Changes

These modules are canonically located within a private Chainguard repository, and are continuously pushed from there to this repository.

If you would like to submit a PR, please do make one against this repository. After the review process, someone at Chainguard will merge it into our internal repository, and the change will then be pushed here.

Directories

Path Synopsis
cmd
replayer command
modules
github-bots/sdk
Package sdk provides a framework for building GitHub bots that receive and handle GitHub webhook events delivered as CloudEvents.
Package sdk provides a framework for building GitHub bots that receive and handle GitHub webhook events delivered as CloudEvents.
github-bots/sdk/check
Package check provides utilities for creating and updating GitHub Check Runs.
Package check provides utilities for creating and updating GitHub Check Runs.
github-bots/sdk/octosts
Package octosts provides utilities for working with OctoSTS bot users.
Package octosts provides utilities for working with OctoSTS bot users.
github-events/internal/schemagen
Package schemagen provides utilities for generating BigQuery JSON schema files from Go types.
Package schemagen provides utilities for generating BigQuery JSON schema files from Go types.
github-events/internal/secrets
Package secrets provides utilities for loading webhook secrets from the environment.
Package secrets provides utilities for loading webhook secrets from the environment.
github-events/internal/trampoline
Package trampoline implements an HTTP server that receives GitHub webhook events, validates their signatures, and forwards them as CloudEvents to a broker ingress.
Package trampoline implements an HTTP server that receives GitHub webhook events, validates their signatures, and forwards them as CloudEvents to a broker ingress.
github-events/schemas
Package schemas defines Go types for GitHub webhook event payloads as stored in BigQuery.
Package schemas defines Go types for GitHub webhook event payloads as stored in BigQuery.
linear-events/internal/secrets
Package secrets provides utilities for loading webhook secrets from the environment.
Package secrets provides utilities for loading webhook secrets from the environment.
linear-events/internal/trampoline
Package trampoline implements an HTTP server that receives Linear webhook events, validates their signatures, and forwards them as CloudEvents to a broker ingress.
Package trampoline implements an HTTP server that receives Linear webhook events, validates their signatures, and forwards them as CloudEvents to a broker ingress.
zendesk-events/internal/redact
Package redact scrubs customer-identifying information from a Zendesk webhook body before the trampoline forwards it as a CloudEvent — so nothing identifying lands in the broker, GCS, or BigQuery.
Package redact scrubs customer-identifying information from a Zendesk webhook body before the trampoline forwards it as a CloudEvent — so nothing identifying lands in the broker, GCS, or BigQuery.
zendesk-events/internal/secrets
Package secrets provides utilities for loading webhook secrets from the environment.
Package secrets provides utilities for loading webhook secrets from the environment.
zendesk-events/internal/trampoline
Package trampoline implements an HTTP server that receives Zendesk webhook events (from Zendesk event subscriptions), validates their signatures, and forwards them as CloudEvents to a broker ingress.
Package trampoline implements an HTTP server that receives Zendesk webhook events (from Zendesk event subscriptions), validates their signatures, and forwards them as CloudEvents to a broker ingress.
cron/example module
pkg
gitexec
Package gitexec wraps local git invocations so every operation emits one structured clog line and updates a small set of Prometheus metrics.
Package gitexec wraps local git invocations so every operation emits one structured clog line and updates a small set of Prometheus metrics.
gitexec/gitenv
Package gitenv builds the process environment for a git subprocess that trusts nothing on the host and carries its credential only to the remote it is meant for.
Package gitenv builds the process environment for a git subprocess that trusts nothing on the host and carries its credential only to the remote it is meant for.
gitexec/gogit
Package gogit is a thin observability shim over go-git: a drop-in for the subset of github.com/go-git/go-git/v5 that performs network I/O, so callers keep writing ordinary go-git and every clone, fetch, and push is recorded through gitexec without per-call instrumentation.
Package gogit is a thin observability shim over go-git: a drop-in for the subset of github.com/go-git/go-git/v5 that performs network I/O, so callers keep writing ordinary go-git and every clone, fetch, and push is recorded through gitexec without per-call instrumentation.
httpmetrics
Package httpmetrics provides HTTP middleware and transport wrappers that instrument requests with Prometheus metrics, OpenTelemetry tracing, and structured logging for Cloud Run services.
Package httpmetrics provides HTTP middleware and transport wrappers that instrument requests with Prometheus metrics, OpenTelemetry tracing, and structured logging for Cloud Run services.
httpmetrics/cloudevents
Package cloudevents provides helpers for creating CloudEvents HTTP clients and targets that are instrumented with httpmetrics middleware.
Package cloudevents provides helpers for creating CloudEvents HTTP clients and targets that are instrumented with httpmetrics middleware.
leasepool
Package leasepool provides named, renewable leases for cooperative leadership.
Package leasepool provides named, renewable leases for cooperative leadership.
leasepool/gcs
Package gcs implements named lease pools using conditional Cloud Storage writes.
Package gcs implements named lease pools using conditional Cloud Storage writes.
leasepool/internal/contract
Package contract exercises the public contract against each lease pool backend.
Package contract exercises the public contract against each lease pool backend.
leasepool/internal/engine
Package engine shares lease timing and ownership semantics across stores.
Package engine shares lease timing and ownership semantics across stores.
leasepool/memory
Package memory implements a process-local lease pool for tests and local use.
Package memory implements a process-local lease pool for tests and local use.
memusage
Package memusage logs Linux process and container memory high-water marks.
Package memusage logs Linux process and container memory high-water marks.
prober
Package prober provides a framework for implementing Chainguard probers that expose an HTTP endpoint for health checking.
Package prober provides a framework for implementing Chainguard probers that expose an HTTP endpoint for health checking.
profiler
Package profiler provides helpers for enabling Google Cloud Profiler in Cloud Run services.
Package profiler provides helpers for enabling Google Cloud Profiler in Cloud Run services.
pubsub
Package pubsub provides helpers for converting CloudEvents to and from Google Cloud Pub/Sub messages.
Package pubsub provides helpers for converting CloudEvents to and from Google Cloud Pub/Sub messages.
rotate
Package rotate provides utilities for uploading and rotating log files to cloud blob storage.
Package rotate provides utilities for uploading and rotating log files to cloud blob storage.
tracesplit
Package tracesplit re-roots a unit of work into its own trace, paired with a handoff span in the caller's trace.
Package tracesplit re-roots a unit of work into its own trace, paired with a handoff span in the caller's trace.
valkey
Package valkey connects to Memorystore for Valkey instances created by the terraform valkey module.
Package valkey connects to Memorystore for Valkey instances created by the terraform valkey module.

Jump to

Keyboard shortcuts

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