-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DTSPO-15909 - migrated Application Insights (#136)
* DTSPO-15909 - migrated Application Insights * fix tf version
- Loading branch information
Showing
7 changed files
with
49 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.1.7 | ||
1.6.6 |
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,27 +1,28 @@ | ||
resource "azurerm_key_vault_secret" "AZURE_APPINSIGHTS_KEY" { | ||
name = "app-insights-instrumentation-key" | ||
value = azurerm_application_insights.appinsights.instrumentation_key | ||
value = module.application_insights.instrumentation_key | ||
key_vault_id = module.vault.key_vault_id | ||
} | ||
|
||
resource "azurerm_key_vault_secret" "app_insights_connection_string" { | ||
name = "app-insights-connection-string" | ||
value = azurerm_application_insights.appinsights.connection_string | ||
value = module.application_insights.connection_string | ||
key_vault_id = module.vault.key_vault_id | ||
} | ||
|
||
resource "azurerm_application_insights" "appinsights" { | ||
name = "${var.product}-${var.env}" | ||
module "application_insights" { | ||
source = "[email protected]:hmcts/terraform-module-application-insights?ref=main" | ||
|
||
env = var.env | ||
product = var.product | ||
location = var.location | ||
resource_group_name = azurerm_resource_group.rg.name | ||
application_type = var.application_type | ||
tags = var.common_tags | ||
resource_group_name = azurerm_resource_group.rg.name | ||
|
||
common_tags = var.common_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, | ||
] | ||
} | ||
moved { | ||
from = azurerm_application_insights.appinsights | ||
to = module.application_insights.azurerm_application_insights.this | ||
} |
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,8 +1,8 @@ | ||
// single alert to minify unnecessary cost because threshold used in here is minimal | ||
module "reform-scan-exception-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "Reform_Scan_exception" | ||
|
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 @@ | ||
module "blob-router-service-liveness-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "Blob_Router_Service_liveness" | ||
|
@@ -26,8 +26,8 @@ EOF | |
|
||
module "reform-scan-notification-service-liveness-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "Reform_Scan_Notification_Service_liveness" | ||
|
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 @@ | ||
module "no-cft-envelopes-processed-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "No_cft_envelopes_processed_-_Blob_Router" | ||
|
@@ -25,8 +25,8 @@ EOF | |
|
||
module "no-crime-envelopes-processed-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "No_crime_envelopes_processed_-_Blob_Router" | ||
|
@@ -50,8 +50,8 @@ EOF | |
|
||
module "no-pcq-envelopes-processed-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "No_pcq_envelopes_processed_-_Blob_Router" | ||
|
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,12 +1,11 @@ | ||
module "reform-scan-notifications-alert" { | ||
source = "[email protected]:hmcts/cnp-module-metric-alert" | ||
location = azurerm_application_insights.appinsights.location | ||
app_insights_name = azurerm_application_insights.appinsights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "Reform_Scan_notification" | ||
alert_desc = "Triggers when notification service receives at least 5 notifications within a 30 minutes window timeframe." | ||
common_tags = var.common_tags | ||
location = var.location | ||
app_insights_name = module.application_insights.name | ||
enabled = var.env == "prod" | ||
alert_name = "Reform_Scan_notification" | ||
alert_desc = "Triggers when notification service receives at least 5 notifications within a 30 minutes window timeframe." | ||
common_tags = var.common_tags | ||
|
||
app_insights_query = "traces | where message startswith 'Started processing notification message'" | ||
|
||
|
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 @@ | ||
module "blob-dispatcher-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "Dispatch_Files" | ||
|
@@ -22,8 +22,8 @@ module "blob-dispatcher-alert" { | |
|
||
module "delete-dispatched-files-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "Delete_Dispatched_Files" | ||
|
@@ -44,8 +44,8 @@ module "delete-dispatched-files-alert" { | |
|
||
module "handle-rejected-files-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "Handle_Rejected_Files" | ||
|
@@ -69,8 +69,8 @@ module "handle-rejected-files-alert" { | |
|
||
module "reject-duplicates-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "Reject_Duplicates" | ||
|
@@ -94,8 +94,8 @@ module "reject-duplicates-alert" { | |
|
||
module "delete-rejected-files-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "Delete_Rejected_Files" | ||
|
@@ -119,8 +119,8 @@ module "delete-rejected-files-alert" { | |
|
||
module "check-new-envelopes-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "Check-New-Envelopes" | ||
|
@@ -142,8 +142,8 @@ module "check-new-envelopes-alert" { | |
|
||
module "send-notifications-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "Reform-Scan-Send-Notifications" | ||
|
@@ -164,8 +164,8 @@ module "send-notifications-alert" { | |
|
||
module "send-notifications-to-scan-provider-alert" { | ||
source = "[email protected]: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 = module.application_insights.name | ||
|
||
enabled = var.env == "prod" | ||
alert_name = "Reform-Scan-Pending-Notifications" | ||
|