Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Implement Azure Monitor - Service Health Alerts #50

Closed
benhurjoel opened this issue Jul 2, 2020 · 1 comment
Closed

[feature] Implement Azure Monitor - Service Health Alerts #50

benhurjoel opened this issue Jul 2, 2020 · 1 comment
Labels
enhancement New feature or request landingzone_caf_foundations Related to landingzone_caf_foundations

Comments

@benhurjoel
Copy link

Is your feature request related to a problem? Please describe.
Would like to add a feature enhancement of Monitoring Module in to the CAF Foundations. The Module may include the monitoring and alerts elements that may be needed in the Landing Zone.

Describe the solution you'd like

Planned inclusion:

landingzone_caf_foundations
|_ blueprint_foundations_monitoring --> New
|_ Service health Alerts

An alert/set of alerts to be triggered in the event of :

  • Service Issue (Global and Region wide)
  • Planned maintenance
  • Health Advisories
  • Security Advisories

Components to be created:

  • An action group.
  • Set of alert rules

Pseudo Code
resource "azurerm_monitor_action_group" "ag1" {
name = var.name
resource_group_name = var.rg
short_name = var.shortname
enabled = #boolean_value from variable set

dynamic "email_receiver" {
for_each = enable_email_alert == false ? [] : [1] # decider from variable set
content {
#from variable set
}
}

dynamic "sms_receiver" {
for_each = enable_sms_alert == false? [] : [1] # decider from variable set
content {
#from variable set
}
}

dynamic "webhook_receiver" {
for_each = enable_webhook_trigger == false ? [] : [1] # decider from variable set
content {
#from variable set
}
}

dynamic "arm_role_receiver" {
for_each = enable_arm_role_alert == false ? [] : [1] # decider from variable set
content {
#from variable set
}
}

}

#Due to the current limitations of 'azurerm_monitor_activity_log_alert' Resource, implementing this alert using ARM Template.

resource "azurerm_template_deployment" "alert1" {
name = "random_name"
resource_group_name = var.rg

template_body = file("${path.module}/filename.json")
parameters = {
"name" = "name"
"actionGroups_name" = azurerm_monitor_action_group.ag1.name
"region" = "${join(",", var.alert_settings.service_health_alerts.location)}" #from variable set
}
deployment_mode = "Incremental"

}

Reference
hashicorp/terraform-provider-azurerm#7392
https://docs.microsoft.com/en-us/azure/service-health/service-health-overview
https://www.terraform.io/docs/providers/azurerm/r/monitor_activity_log_alert.html

@benhurjoel benhurjoel added the enhancement New feature or request label Jul 2, 2020
@arnaudlh arnaudlh added the landingzone_caf_foundations Related to landingzone_caf_foundations label Jul 2, 2020
@arnaudlh
Copy link
Member

This has been added to core module - need to implement into ALZ scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request landingzone_caf_foundations Related to landingzone_caf_foundations
Projects
None yet
Development

No branches or pull requests

2 participants