Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add intercepting sinks to the organization and folder modules #2799

Next Next commit
RS-469: add support for intercept child on audit logging
rshokati2 committed Dec 23, 2024
commit 466e005d87a75c7d86841e21a71f90a012accec1
17 changes: 9 additions & 8 deletions modules/organization/logging.tf
Original file line number Diff line number Diff line change
@@ -56,14 +56,15 @@ resource "google_organization_iam_audit_config" "default" {
}

resource "google_logging_organization_sink" "sink" {
for_each = local.logging_sinks
name = each.key
description = coalesce(each.value.description, "${each.key} (Terraform-managed).")
org_id = local.organization_id_numeric
destination = "${each.value.type}.googleapis.com/${each.value.destination}"
filter = each.value.filter
include_children = each.value.include_children
disabled = each.value.disabled
for_each = local.logging_sinks
name = each.key
description = coalesce(each.value.description, "${each.key} (Terraform-managed).")
org_id = local.organization_id_numeric
destination = "${each.value.type}.googleapis.com/${each.value.destination}"
filter = each.value.filter
include_children = each.value.include_children
intercept_children = each.value.intercept_children
disabled = each.value.disabled

dynamic "bigquery_options" {
for_each = each.value.type == "bigquery" ? [""] : []
3 changes: 2 additions & 1 deletion modules/organization/variables-logging.tf
Original file line number Diff line number Diff line change
@@ -56,7 +56,8 @@ variable "logging_sinks" {
exclusions = optional(map(string), {})
filter = optional(string)
iam = optional(bool, true)
include_children = optional(bool, true)
include_children = each.value.include_children
intercept_children = each.value.intercept_children
type = string
}))
default = {}