Adds support for log exclusions in billingAccounts, organizations, folders and projects, see: https://cloud.google.com/logging/docs/exclusions ``` ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./google -v -run=Exclusion -timeout 120m === RUN TestAccLoggingBillingAccountExclusion_basic === PAUSE TestAccLoggingBillingAccountExclusion_basic === RUN TestAccLoggingBillingAccountExclusion_update === PAUSE TestAccLoggingBillingAccountExclusion_update === RUN TestAccLoggingFolderExclusion_basic === PAUSE TestAccLoggingFolderExclusion_basic === RUN TestAccLoggingFolderExclusion_folderAcceptsFullFolderPath === PAUSE TestAccLoggingFolderExclusion_folderAcceptsFullFolderPath === RUN TestAccLoggingFolderExclusion_update === PAUSE TestAccLoggingFolderExclusion_update === RUN TestAccLoggingOrganizationExclusion_basic === PAUSE TestAccLoggingOrganizationExclusion_basic === RUN TestAccLoggingOrganizationExclusion_update === PAUSE TestAccLoggingOrganizationExclusion_update === RUN TestAccLoggingProjectExclusion_basic === PAUSE TestAccLoggingProjectExclusion_basic === RUN TestAccLoggingProjectExclusion_disablePreservesFilter === PAUSE TestAccLoggingProjectExclusion_disablePreservesFilter === RUN TestAccLoggingProjectExclusion_update === PAUSE TestAccLoggingProjectExclusion_update === CONT TestAccLoggingBillingAccountExclusion_basic === CONT TestAccLoggingOrganizationExclusion_update === CONT TestAccLoggingProjectExclusion_update === CONT TestAccLoggingFolderExclusion_folderAcceptsFullFolderPath === CONT TestAccLoggingOrganizationExclusion_basic --- PASS: TestAccLoggingProjectExclusion_update (3.60s) --- PASS: TestAccLoggingOrganizationExclusion_update (4.40s) === CONT TestAccLoggingFolderExclusion_update --- PASS: TestAccLoggingOrganizationExclusion_basic (1.90s) === CONT TestAccLoggingFolderExclusion_basic --- PASS: TestAccLoggingBillingAccountExclusion_basic (6.21s) === CONT TestAccLoggingBillingAccountExclusion_update --- PASS: TestAccLoggingBillingAccountExclusion_update (5.90s) === CONT TestAccLoggingProjectExclusion_disablePreservesFilter --- PASS: TestAccLoggingProjectExclusion_disablePreservesFilter (3.90s) === CONT TestAccLoggingProjectExclusion_basic --- PASS: TestAccLoggingFolderExclusion_folderAcceptsFullFolderPath (16.67s) --- PASS: TestAccLoggingProjectExclusion_basic (1.96s) --- PASS: TestAccLoggingFolderExclusion_basic (15.30s) --- PASS: TestAccLoggingFolderExclusion_update (18.35s) PASS ok github.com/terraform-providers/terraform-provider-google/google 22.810s ```
1.9 KiB
layout | page_title | sidebar_current | description |
---|---|---|---|
Google: google_logging_folder_exclusion | docs-google-logging-folder-exclusion | Manages a folder-level logging exclusion. |
google_logging_folder_exclusion
Manages a folder-level logging exclusion. For more information see the official documentation and Excluding Logs.
Note that you must have the "Logs Configuration Writer" IAM role (roles/logging.configWriter
)
granted to the credentials used with Terraform.
Example Usage
resource "google_logging_folder_exclusion" "my-exclusion" {
name = "my-instance-debug-exclusion"
folder = "${google_folder.my-folder.name}"
description = "Exclude GCE instance debug logs"
# Exclude all DEBUG or lower severity messages relating to instances
filter = "resource.type = gce_instance AND severity <= DEBUG"
}
resource "google_folder" "my-folder" {
display_name = "My folder"
parent = "organizations/123456"
}
Argument Reference
The following arguments are supported:
-
folder
- (Required) The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted. -
name
- (Required) The name of the logging exclusion. -
description
- (Optional) A human-readable description. -
disabled
- (Optional) Whether this exclusion rule should be disabled or not. This defaults to false. -
filter
- (Required) The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
Import
Folder-level logging exclusions can be imported using their URI, e.g.
$ terraform import google_logging_folder_exclusion.my_exclusion folders/my-folder/exclusions/my-exclusion