From 9caafe669019977af980de1ef42f7aac0928039f Mon Sep 17 00:00:00 2001 From: Tanguy <92095568+tanguynicolas@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:30:17 +0200 Subject: [PATCH] feat: adding `description` argument to log sinks (#212) Co-authored-by: Tanguy NICOLAS --- README.md | 1 + main.tf | 4 ++++ variables.tf | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/README.md b/README.md index df4bfcc4..3e6c3770 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ so that all dependencies are met. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | bigquery\_options | (Optional) Options that affect sinks exporting data to BigQuery. use\_partitioned\_tables - (Required) Whether to use BigQuery's partition tables. |
object({
use_partitioned_tables = bool
})
| `null` | no | +| description | A description of this sink. The maximum length of the description is 8000 characters. | `string` | `null` | no | | destination\_uri | The self\_link URI of the destination resource (This is available as an output coming from one of the destination submodules) | `string` | n/a | yes | | disabled | (Optional) If set to true, then the sink is disabled and it does not export any log entries. | `bool` | `false` | no | | exclusions | (Optional) A list of sink exclusion filters. |
list(object({
name = string,
description = string,
filter = string,
disabled = bool
}))
| `[]` | no | diff --git a/main.tf b/main.tf index d325c387..5ef7743b 100644 --- a/main.tf +++ b/main.tf @@ -41,6 +41,7 @@ locals { resource "google_logging_project_sink" "sink" { count = local.is_project_level ? 1 : 0 name = var.log_sink_name + description = var.description project = var.parent_resource_id filter = var.filter destination = var.destination_uri @@ -68,6 +69,7 @@ resource "google_logging_project_sink" "sink" { resource "google_logging_folder_sink" "sink" { count = local.is_folder_level ? 1 : 0 name = var.log_sink_name + description = var.description folder = var.parent_resource_id filter = var.filter include_children = var.include_children @@ -95,6 +97,7 @@ resource "google_logging_folder_sink" "sink" { resource "google_logging_organization_sink" "sink" { count = local.is_org_level ? 1 : 0 name = var.log_sink_name + description = var.description org_id = var.parent_resource_id filter = var.filter include_children = var.include_children @@ -122,6 +125,7 @@ resource "google_logging_organization_sink" "sink" { resource "google_logging_billing_account_sink" "sink" { count = local.is_billing_level ? 1 : 0 name = var.log_sink_name + description = var.description billing_account = var.parent_resource_id filter = var.filter destination = var.destination_uri diff --git a/variables.tf b/variables.tf index f08f5b8c..03ee7caa 100644 --- a/variables.tf +++ b/variables.tf @@ -36,6 +36,12 @@ variable "log_sink_name" { type = string } +variable "description" { + description = "A description of this sink. The maximum length of the description is 8000 characters." + type = string + default = null +} + variable "parent_resource_id" { description = "The ID of the GCP resource in which you create the log sink. If var.parent_resource_type is set to 'project', then this is the Project ID (and etc)." type = string