Skip to content

Commit

Permalink
feat: adding description argument to log sinks (#212)
Browse files Browse the repository at this point in the history
Co-authored-by: Tanguy NICOLAS <[email protected]>
  • Loading branch information
tanguynicolas and Tanguy NICOLAS authored Apr 29, 2024
1 parent 0a63235 commit 9caafe6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. | <pre>object({<br> use_partitioned_tables = bool<br> })</pre> | `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. | <pre>list(object({<br> name = string,<br> description = string,<br> filter = string,<br> disabled = bool<br> }))</pre> | `[]` | no |
Expand Down
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9caafe6

Please sign in to comment.