From 661f0065da6ebdc0e5a2e1fcab52f7372e9589c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bagrowski?= Date: Mon, 29 May 2023 10:07:59 +0200 Subject: [PATCH] feat: add posibility to disable iam notyfications --- README.md | 1 + main.tf | 1 + modules/budget/README.md | 1 + modules/budget/main.tf | 1 + modules/budget/variables.tf | 6 ++++++ variables.tf | 6 ++++++ 6 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 873944ba..c15fa339 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,7 @@ determining that location is as follows: | budget\_display\_name | The display name of the budget. If not set defaults to `Budget For ` | `string` | `null` | no | | budget\_labels | A single label and value pair specifying that usage from only this set of labeled resources should be included in the budget. | `map(string)` | `{}` | no | | budget\_monitoring\_notification\_channels | A list of monitoring notification channels in the form `[projects/{project_id}/notificationChannels/{channel_id}]`. A maximum of 5 channels are allowed. | `list(string)` | `[]` | no | +| disable_default_iam_recipients | Disables default notifications sent when a threshold is exceeded | bool | `null` | no | | consumer\_quotas | The quotas configuration you want to override for the project. |
list(object({
service = string,
metric = string,
dimensions = map(string),
limit = string,
value = string,
}))
| `[]` | no | | create\_project\_sa | Whether the default service account for the project shall be created | `bool` | `true` | no | | default\_network\_tier | Default Network Service Tier for resources created in this project. If unset, the value will not be modified. See https://cloud.google.com/network-tiers/docs/using-network-service-tiers and https://cloud.google.com/network-tiers. | `string` | `""` | no | diff --git a/main.tf b/main.tf index 4193db31..6200e8ab 100644 --- a/main.tf +++ b/main.tf @@ -105,6 +105,7 @@ module "budget" { calendar_period = var.budget_calendar_period custom_period_start_date = var.budget_custom_period_start_date custom_period_end_date = var.budget_custom_period_end_date + disable_default_iam_recipients = var.budget_disable_default_iam_recipients } /****************************************** diff --git a/modules/budget/README.md b/modules/budget/README.md index 0b96a947..b32e55ec 100644 --- a/modules/budget/README.md +++ b/modules/budget/README.md @@ -35,6 +35,7 @@ module "project_myproject" { | monitoring\_notification\_channels | A list of monitoring notification channels in the form `[projects/{project_id}/notificationChannels/{channel_id}]`. A maximum of 5 channels are allowed. | `list(string)` | `[]` | no | | projects | The project ids to include in this budget. If empty budget will include all projects | `list(string)` | n/a | yes | | services | A list of services ids to be included in the budget. If omitted, all services will be included in the budget. Service ids can be found at https://cloud.google.com/skus/ | `list(string)` | `null` | no | +| disable_default_iam_recipients | Disables default notifications sent when a threshold is exceeded | bool | `null` | no | ## Outputs diff --git a/modules/budget/main.tf b/modules/budget/main.tf index eb644314..4f45a4f6 100644 --- a/modules/budget/main.tf +++ b/modules/budget/main.tf @@ -87,6 +87,7 @@ resource "google_billing_budget" "budget" { content { pubsub_topic = var.alert_pubsub_topic monitoring_notification_channels = var.monitoring_notification_channels + disable_default_iam_recipients = var.disable_default_iam_recipients } } } diff --git a/modules/budget/variables.tf b/modules/budget/variables.tf index 75cb6fb3..06fa14e2 100644 --- a/modules/budget/variables.tf +++ b/modules/budget/variables.tf @@ -104,3 +104,9 @@ variable "labels" { error_message = "Only 0 or 1 labels may be supplied for the budget filter." } } + +variable "disable_default_iam_recipients" { + description = "Disables default notifications sent when a threshold is exceeded" + type = bool + default = null +} diff --git a/variables.tf b/variables.tf index 5663c957..4a9d3c25 100644 --- a/variables.tf +++ b/variables.tf @@ -287,6 +287,12 @@ variable "budget_custom_period_end_date" { default = null } +variable "budget_disable_default_iam_recipients" { + description = "Disables default notifications sent when a threshold is exceeded" + type = bool + default = null +} + variable "vpc_service_control_attach_enabled" { description = "Whether the project will be attached to a VPC Service Control Perimeter" type = bool