Skip to content

dsb-norge/terraform-azurerm-consumption-budget-monitoring

Repository files navigation

Terraform module for budget consumption monitoring in Azure

Terraform module to create consumption budget with alerting in Azure.
Module has following features:

  • Create consumption budget (in local currency).
  • Create alert rule on budget consumption threshold with email notification.
  • Create alert with email notification when budget consumption anomaly is detected.

Usage

Refer to examples for usage of module.

Requirements

Name Version
terraform >= 1.8.0, < 2.0.0
azurerm >= 3.0.0, < 5.0.0

Resources

Name Type
azurerm_consumption_budget_subscription.sub_budget_consumption resource
azurerm_cost_anomaly_alert.sub_cost_anomaly_alert resource
azurerm_subscription.current data source

Inputs

Name Description Type Default Required
app_short_name Name of app short, used for rg string n/a yes
consumption_budget_amount The amount of money to be consumed number n/a yes
environment The runtime environment targeted. Development, test, qa, production etc string n/a yes
subscription The subscription string n/a yes
consumption_budget_notification_cfg The notification blocks
map(object({
enabled = optional(bool)
threshold = optional(number)
operator = optional(string)
contact_emails = optional(list(string))
}))
{
"notification1": {
"enabled": false
}
}
no
consumption_budget_time_grain The time grain for the consumption budget string "Monthly" no
cost_anomaly_alert_email_receivers The email addresses to receive cost anomaly alerts list(string) [] no

Outputs

Name Description
consumption_budget_id value of the consumption budget id
cost_anomaly_alert_id value of the cost anomaly alert id

Modules

No modules.

About

Terraform module to create management locks for resources

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages