Google CloudStatic-verified

A Log Sink that Actually Delivers

Creating a sink creates a service account for it and grants that account nothing, so until it holds a role on the destination every export fails - the sink shows active, the destination stays empty, and the errors are logged into the project that was supposed to be exported. Grants the role with the sink, refuses an empty filter, and can manage _Default retention past 30 days.

terraformGoogle Cloudgcp
gcp-log-sinkvizier v1.2.0

Verification

Static-verified

Passed: validated and lint-clean (provider-schema-validated for AWS/Azure/GCP; Terraform-language lint elsewhere).

Conformance

  • Static validation (fmt · validate · tflint)
  • Security scan clean (Checkov)
  • Plan tests (mocked: validation rules · outputs)

Provenance

  • SHA-256 checksum
  • Signature (pending)

Functional

  • Live test pending (no cloud run yet)

Last verified 2026-09-14 · how we verify

Use it from the registry

terraform · opentofu
module "log_sink" {
  source  = "www.iac-bazaar.com/iac-bazaar/gcp-log-sink/gcp"
  version = "1.0.0"
}

Needs a registry token from /account/tokens. The module itself is free; the account is what identifies you. Full setup: registry docs.

Inputs & outputs

Create a free account to read this module's contract

The declared contract - every input name, type, default and description, plus every output - is shown to signed-in accounts, not to anonymous visitors.

A free account sees the contract of every module in the catalogue. There is no subscription and nothing to buy - the modules are free to download, and they run under Vizier.

Documentation

gcp-log-sink

A Cloud Logging sink that actually delivers. Works with Terraform and OpenTofu (>= 1.6), google provider >= 6.0, < 7.0.

A sink whose writer cannot write exports nothing, and says so nowhere useful. Creating a sink creates a service account for it - the writer identity - and grants it nothing. Until that account holds the right role on the destination, every export fails. The sink shows as active, the destination stays empty, and the failures are logged as logging.googleapis.com/sink_error entries in the same project - into the thing that was supposed to be exported. The gap is usually found when somebody goes looking for last year's audit trail. This module grants the role as part of creating the sink: objectCreator on a bucket, dataEditor on a dataset, publisher on a topic, bucketWriter for a log bucket in another project.

An empty filter exports everything. Data Access audit logs, load balancer request logs, application output, all at export prices. Refused without accept_export_everything.

_Default retention is 30 days. Logs that were not exported are gone after a month, which is the setting most incident timelines run into. Set default_bucket_retention_days to manage it; default_bucket_locked makes the retention irreversible and needs accept_locked_bucket.

Verification

Static validation runs tofu fmt, init, validate, tflint and checkov. This module has not yet had a live test, so it is published as statically validated with its live test pending and does not carry the live-tested mark.

Usage code & full reference need an account

The complete copy-paste usage, the full input/output reference, and operational notes are free with an account - shown here and bundled in the download. Sign in and this section fills in.

  • Usage

Related modules