-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add modules for Azure Monitor Metric Alert Rules and Action Gro…
…ups (#8) This PR introduces new modules for Azure Monitor Alert Rules and Action Groups. Furthermore, these modules are now incorporated into existing modules. Other changes are cleanup discovered during the integration of the above. --------- Co-authored-by: Jón Orri @ Skývafnir <[email protected]>
- Loading branch information
Showing
36 changed files
with
851 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,9 @@ module "datafactory" { | |
owners = var.datalakehouse_admins | ||
} | ||
|
||
alert_on_pipeline_failure = var.alert_on_pipeline_failure | ||
pipeline_failure_alert_emails = var.alert_contact_emails | ||
|
||
tags = local.tags | ||
} | ||
|
||
|
@@ -144,8 +147,8 @@ module "datawarehouse" { | |
sql_server_name_override = try(var.name_overrides.sql_server, null) | ||
keyvault_key_name_override = try(var.name_overrides.warehouse_audit_keyvault_key, null) | ||
audit_storage_account_name_override = try(var.name_overrides.warehouse_audit_storage_account, null) | ||
monitor_alert_emails = ["[email protected]"] | ||
enable_monitor_alerts = true | ||
monitor_alert_emails = var.alert_contact_emails | ||
enable_db_monitor_alerts = true | ||
|
||
datawarehouse_contributor_principal_ids = { | ||
"Data Engineer Group" = module.data_engineer_user_group[0].group_id | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
# TODO: All of this needs to move to a module | ||
module "defaults" { | ||
source = "../../modules/skyvafnir/defaults" | ||
resource_abbreviation = "logs" | ||
tags = var.tags | ||
caller = basename(path.module) | ||
org_code = var.org_code | ||
tier = var.tier | ||
instance = var.instance | ||
} | ||
|
||
resource "azurerm_log_analytics_workspace" "this" { | ||
name = module.defaults.resource_name | ||
resource_group_name = module.base_setup.resource_group_name | ||
location = module.base_setup.resource_group_location | ||
|
||
tags = module.defaults.tags | ||
} | ||
|
||
resource "azurerm_monitor_diagnostic_setting" "this" { | ||
count = local.data_factory_enabled ? 1 : 0 | ||
name = format(module.defaults.resource_name_template, "diag") | ||
|
||
log_analytics_workspace_id = azurerm_log_analytics_workspace.this.id | ||
target_resource_id = module.datafactory[0].id | ||
|
||
log_analytics_destination_type = "Dedicated" | ||
|
||
enabled_log { | ||
category_group = "allLogs" | ||
} | ||
metric { | ||
category = "AllMetrics" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,3 @@ module "defaults" { | |
tier = var.tier | ||
instance = var.instance | ||
} | ||
|
||
locals { | ||
tags = module.defaults.tags | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
resource "azurerm_management_lock" "this" { | ||
count = var.lock == true ? 1 : 0 | ||
name = format("lock-${local.resource_group_name}") | ||
name = "lock-${module.defaults.resource_name}" | ||
scope = local.resource_group_info.id | ||
lock_level = "CanNotDelete" | ||
notes = "Protect ${local.resource_group_name} from deletion." | ||
notes = "Protect ${module.defaults.resource_name} from deletion." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.