Skip to content

Commit

Permalink
Merge pull request #93 from hmcts/DTSPO-15909-app-insights
Browse files Browse the repository at this point in the history
DTSPO-15909 - migrated Application Insights
  • Loading branch information
cpareek authored Jan 2, 2024
2 parents 2fb5967 + 4ab7b9d commit da87483
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
24 changes: 12 additions & 12 deletions application-insights.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
resource "azurerm_application_insights" "appinsights" {
name = join("-", [var.product, var.env])
location = var.location
module "application_insights" {
source = "git@github.com:hmcts/terraform-module-application-insights?ref=main"

env = var.env
product = var.product
name = var.product

resource_group_name = azurerm_resource_group.rg.name
application_type = var.application_type
tags = local.tags

lifecycle {
ignore_changes = [
# Ignore changes to appinsights as otherwise upgrading to the Azure provider 2.x
# destroys and re-creates this appinsights instance
application_type,
]
}
common_tags = local.tags
}

moved {
from = azurerm_application_insights.appinsights
to = module.application_insights.azurerm_application_insights.this
}
22 changes: 11 additions & 11 deletions emailAlert.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

module "feepay-fail-alert" {
source = "git@github.com:hmcts/cnp-module-metric-alert"
location = azurerm_application_insights.appinsights.location
app_insights_name = azurerm_application_insights.appinsights.name
location = var.location
app_insights_name = "${var.product}-${var.env}"

alert_name = "feepay-fail-alert"
alert_desc = "Triggers when an feepay exception is received."
app_insights_query = "requests | where toint(resultCode) >= 500 | sort by timestamp desc"
alert_name = "feepay-fail-alert"
alert_desc = "Triggers when an feepay exception is received."
app_insights_query = "requests | where toint(resultCode) >= 500 | sort by timestamp desc"

frequency_in_minutes = "15"
time_window_in_minutes = "15"
Expand All @@ -30,18 +30,18 @@ module "feepay-fail-action-group" {
action_group_name = "feepay Fail Alert - ${var.env}"
short_name = "feepay_alert"
email_receiver_name = "feepay Alerts"
email_receiver_address = "${data.azurerm_key_vault_secret.email-alert-recipient.value}"
email_receiver_address = data.azurerm_key_vault_secret.email-alert-recipient.value
}


data "azurerm_key_vault_secret" "email-alert-recipient" {
name = "email-alert-recipient"
key_vault_id = data.azurerm_key_vault.ccpay_key_vault.id
}
output "email-alert-recipient" {
value = data.azurerm_key_vault_secret.email-alert-recipient
sensitive=true
}

output "email-alert-recipient" {
value = data.azurerm_key_vault_secret.email-alert-recipient
sensitive = true
}


0 comments on commit da87483

Please sign in to comment.