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.

Cite it in your README

badge · attribution

Paste this beside the module in the repository that uses it. The badge is rendered from this artifact's verification record, so it reads static-verified because the record says so, and the link lands on this page.

README.md, GitLab, Gitea
[![IaC Bazaar: static-verified](https://www.iac-bazaar.com/api/artifacts/gcp-log-sink/badge)](https://www.iac-bazaar.com/catalog/gcp-log-sink?utm_source=syndication&utm_medium=readme&utm_campaign=artifact)

Terraform module 1.0.0, static-verified on IaC Bazaar: [A Log Sink that Actually Delivers](https://www.iac-bazaar.com/catalog/gcp-log-sink?utm_source=syndication&utm_medium=readme&utm_campaign=artifact)

```hcl
module "log_sink" {
  source  = "www.iac-bazaar.com/iac-bazaar/gcp-log-sink/gcp"
  version = "1.0.0"
}
```

Preview:IaC Bazaar: static-verified

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

Static validatedLive test pending

gcp-uptime-check

A Cloud Monitoring uptime check from static-address checkers in several regions, over TLS with the certificate validated (off by default), asserting on the body when you give it text, with failures logged, and the alert policy on check_passed that sends to your notification channels. Plain HTTP and a policy with no channels are each accepted by name.

View module
Static validatedLive test pending

gcp-audit-logging

Data Access logs are off by default for every service but BigQuery, so a project that never turned them on has no record of who read the bucket, queried the table or fetched the secret. Enables all three log types for allServices, narrows per service where read volume is a real cost, and requires a reason for every exempted member - the setting an intruder with IAM rights would add.

View module
Live-tested

gcp-monitoring

A self-contained observability bundle: a metric-threshold alert policy, a Monitoring dashboard, and a log-export sink to a locked-down GCS bucket with the sink writer-identity IAM grant wired in.

View module
Static validatedLive test pending

gcp-vpc-flow-logs

VPC Flow Logs configs through the Network Management API, one per network, subnet, VPN tunnel or Interconnect attachment. A config for a target that does not exist is accepted and logs nothing, so a check block warns on it. Filters and sampling are reported by name, and the defaults stay Google's most complete: every flow, 5-second aggregation, all metadata.

View module