Skip to content

Commit

Permalink
upd: add pubsub topic option
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisVLRT committed Apr 12, 2023
1 parent 7048121 commit 0c40507
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_budgets"></a> [budgets](#input\_budgets) | Defines budgets and budget alerts for the project | <pre>object({<br> billing_account_id = string<br><br> absolute_amount = optional(object({<br> amount = number<br> alerts = object({<br> notification_channels = set(string)<br> current_threshold_ratio = optional(number)<br> forecasted_threshold_ratio = optional(number)<br> disable_default_iam_recipients = optional(bool, false)<br> })<br> budget_name = optional(string, "Absolute budget alert")<br> }))<br><br> relative_amount = optional(object({<br> alerts = object({<br> notification_channels = set(string)<br> current_threshold_ratio = optional(number)<br> forecasted_threshold_ratio = optional(number)<br> disable_default_iam_recipients = optional(bool, false)<br> })<br> budget_name = optional(string, "Relative budget alert")<br> }))<br> })</pre> | <pre>{<br> "billing_account_id": null<br>}</pre> | no |
| <a name="input_budgets"></a> [budgets](#input\_budgets) | Defines budgets and budget alerts for the project | <pre>object({<br> billing_account_id = string<br><br> absolute_amount = optional(object({<br> amount = number<br> alerts = object({<br> notification_channels = set(string)<br> pubsub_topic = optional(string)<br> current_threshold_ratio = optional(number)<br> forecasted_threshold_ratio = optional(number)<br> disable_default_iam_recipients = optional(bool, false)<br> })<br> budget_name = optional(string, "Absolute budget alert")<br> }))<br><br> relative_amount = optional(object({<br> alerts = object({<br> notification_channels = set(string)<br> pubsub_topic = optional(string)<br> current_threshold_ratio = optional(number)<br> forecasted_threshold_ratio = optional(number)<br> disable_default_iam_recipients = optional(bool, false)<br> })<br> budget_name = optional(string, "Relative budget alert")<br> }))<br> })</pre> | <pre>{<br> "billing_account_id": null<br>}</pre> | no |
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | GCP project ID | `string` | n/a | yes |
| <a name="input_quotas"></a> [quotas](#input\_quotas) | Defines quotas and quotas alerts for the project | <pre>object({<br> bigquery_quota_tb_per_day_total = optional(number, 10)<br> bigquery_quota_tb_per_day_per_user = optional(number, 10)<br><br> alerts = optional(object({<br> notification_channels = set(string)<br> bigquery_quota_tb_per_day_total_threshold_ratio = optional(number)<br> bigquery_quota_tb_per_day_per_user_threshold_ratio = optional(number)<br> }))<br> })</pre> | `{}` | no |

Expand Down
2 changes: 2 additions & 0 deletions budget.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ resource "google_billing_budget" "relative_amount_budget" {

all_updates_rule {
monitoring_notification_channels = var.budgets.relative_amount.alerts.notification_channels
pubsub_topic = var.budgets.relative_amount.alerts.pubsub_topic
disable_default_iam_recipients = var.budgets.relative_amount.alerts.disable_default_iam_recipients
}

Expand Down Expand Up @@ -66,6 +67,7 @@ resource "google_billing_budget" "absolute_amount_budget" {

all_updates_rule {
monitoring_notification_channels = var.budgets.absolute_amount.alerts.notification_channels
pubsub_topic = var.budgets.absolute_amount.alerts.pubsub_topic
disable_default_iam_recipients = var.budgets.absolute_amount.alerts.disable_default_iam_recipients
}

Expand Down
2 changes: 2 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ variable "budgets" {
amount = number
alerts = object({
notification_channels = set(string)
pubsub_topic = optional(string)
current_threshold_ratio = optional(number)
forecasted_threshold_ratio = optional(number)
disable_default_iam_recipients = optional(bool, false)
Expand All @@ -38,6 +39,7 @@ variable "budgets" {
relative_amount = optional(object({
alerts = object({
notification_channels = set(string)
pubsub_topic = optional(string)
current_threshold_ratio = optional(number)
forecasted_threshold_ratio = optional(number)
disable_default_iam_recipients = optional(bool, false)
Expand Down

0 comments on commit 0c40507

Please sign in to comment.