Google Cloud (Stackdriver) Logging Folder Exclusion
This page shows how to write Terraform for Cloud (Stackdriver) Logging Folder Exclusion and write them securely.
google_logging_folder_exclusion (Terraform)
The Folder Exclusion in Cloud (Stackdriver) Logging can be configured in Terraform with the resource name google_logging_folder_exclusion
. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "google_logging_folder_exclusion" "exclusion" {
count = length(var.exclusion)
filter = lookup(var.exclusion[count.index], "filter")
folder = element(var.folder, lookup(var.exclusion[count.index], "folder_id"))
name = lookup(var.exclusion[count.index], "name")
description = lookup(var.exclusion[count.index], "description", null)
resource "google_logging_folder_exclusion" "this" {
description = var.description
disabled = var.disabled
filter = var.filter
folder = var.folder
name = var.name
Parameters
-
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.
The name of the logging exclusion.
Explanation in Terraform Registry
Manages a folder-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_folder_sink
Frequently asked questions
What is Google Cloud (Stackdriver) Logging Folder Exclusion?
Google Cloud (Stackdriver) Logging Folder 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 Folder Exclusion?
For Terraform, the mikamakusa/terraform and niveklabs/google source code examples are useful. See the Terraform Example section for further details.