Skip to content

Commit

Permalink
add posibility to disable iam notyfications
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbagrowski committed May 29, 2023
1 parent 7dc8e04 commit 4d828f6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <projects[0]|All Projects>` | `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. | <pre>list(object({<br> service = string,<br> metric = string,<br> dimensions = map(string),<br> limit = string,<br> value = string,<br> }))</pre> | `[]` | 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 |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/******************************************
Expand Down
1 change: 1 addition & 0 deletions modules/budget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions modules/budget/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
6 changes: 6 additions & 0 deletions modules/budget/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4d828f6

Please sign in to comment.