Google Cloud (Stackdriver) Logging Project Exclusion

This page shows how to write Terraform for Cloud (Stackdriver) Logging Project Exclusion and write them securely.

google_logging_project_exclusion (Terraform)

The Project Exclusion in Cloud (Stackdriver) Logging can be configured in Terraform with the resource name google_logging_project_exclusion. The following sections describe 1 example of how to use the resource and its parameters.

Example Usage from GitHub

resource "google_logging_project_exclusion" "gce-ops-agent-logs-exclusion" {
  project = var.project

  name        = "gce-ops-agent-logs-exclusion"
  description = "Exclude google-cloud-ops-agent from GCE instancess"


  • description optional - string
    • A human-readable description.

  • disabled optional - bool
    • Whether this exclusion rule should be disabled or not. This defaults to false.

  • filter required - string
    • The filter to apply when excluding logs. Only log entries that match the filter are excluded.

  • id optionalcomputed - string
  • name required - string
    • The name of the logging exclusion.

  • project optionalcomputed - string

Explanation in Terraform Registry

Manages a project-level logging exclusion. For more information see:

  • API documentation
  • How-to Guides
    • Excluding Logs

      You can specify exclusions for log sinks created by terraform by using the exclusions field of google_logging_project_sink

Frequently asked questions

What is Google Cloud (Stackdriver) Logging Project Exclusion?

Google Cloud (Stackdriver) Logging Project Exclusion is a resource for Cloud (Stackdriver) Logging of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Cloud (Stackdriver) Logging Project Exclusion?

For Terraform, the matihost/learning source code example is useful. See the Terraform Example section for further details.


Scan your IaC problem in 3 minutes for free

You can keep your IaC security for free. No credit card required.