Skip to content

Commit

Permalink
feat: Add budget_monitoring_notification_channels to modules includin…
Browse files Browse the repository at this point in the history
…g budgets (#476)

Co-authored-by: Bharath KKB <[email protected]>
  • Loading branch information
davidholsgrove and bharathkkb authored Oct 12, 2020
1 parent e9f0c8f commit d1665d1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions modules/gsuite_enabled/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ The roles granted are specifically:
| budget\_alert\_pubsub\_topic | The name of the Cloud Pub/Sub topic where budget related messages will be published, in the form of `projects/{project_id}/topics/{topic_id}` | string | `"null"` | no |
| budget\_alert\_spent\_percents | A list of percentages of the budget to alert on when threshold is exceeded | list(number) | `<list>` | no |
| budget\_amount | The amount to use for a budget alert | number | `"null"` | 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) | `<list>` | no |
| create\_group | Whether to create the group or not | bool | `"false"` | no |
| credentials\_path | Path to a service account credentials file with rights to run the Project Factory. If this file is absent Terraform will fall back to Application Default Credentials. | string | `""` | no |
| default\_service\_account | Project default service account setting: can be one of `delete`, `deprivilege`, `disable`, or `keep`. | string | `"disable"` | no |
Expand Down
11 changes: 6 additions & 5 deletions modules/gsuite_enabled/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ module "budget" {
source = "../budget"
create_budget = var.budget_amount != null

projects = [module.project-factory.project_id]
billing_account = var.billing_account
amount = var.budget_amount
alert_spent_percents = var.budget_alert_spent_percents
alert_pubsub_topic = var.budget_alert_pubsub_topic
projects = [module.project-factory.project_id]
billing_account = var.billing_account
amount = var.budget_amount
alert_spent_percents = var.budget_alert_spent_percents
alert_pubsub_topic = var.budget_alert_pubsub_topic
monitoring_notification_channels = var.budget_monitoring_notification_channels
}
6 changes: 6 additions & 0 deletions modules/gsuite_enabled/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ variable "budget_alert_pubsub_topic" {
default = null
}

variable "budget_monitoring_notification_channels" {
description = "A list of monitoring notification channels in the form `[projects/{project_id}/notificationChannels/{channel_id}]`. A maximum of 5 channels are allowed."
type = list(string)
default = []
}

variable "budget_alert_spent_percents" {
description = "A list of percentages of the budget to alert on when threshold is exceeded"
type = list(number)
Expand Down
11 changes: 6 additions & 5 deletions modules/shared_vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ module "budget" {
source = "../budget"
create_budget = var.budget_amount != null

projects = [module.project-factory.project_id]
billing_account = var.billing_account
amount = var.budget_amount
alert_spent_percents = var.budget_alert_spent_percents
alert_pubsub_topic = var.budget_alert_pubsub_topic
projects = [module.project-factory.project_id]
billing_account = var.billing_account
amount = var.budget_amount
alert_spent_percents = var.budget_alert_spent_percents
alert_pubsub_topic = var.budget_alert_pubsub_topic
monitoring_notification_channels = var.budget_monitoring_notification_channels
}
6 changes: 6 additions & 0 deletions modules/shared_vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ variable "budget_alert_pubsub_topic" {
default = null
}

variable "budget_monitoring_notification_channels" {
description = "A list of monitoring notification channels in the form `[projects/{project_id}/notificationChannels/{channel_id}]`. A maximum of 5 channels are allowed."
type = list(string)
default = []
}

variable "budget_alert_spent_percents" {
description = "A list of percentages of the budget to alert on when threshold is exceeded"
type = list(number)
Expand Down

0 comments on commit d1665d1

Please sign in to comment.