Skip to content

Commit

Permalink
Merge pull request #7 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 4, 2024
2 parents 4d2dd30 + 7aa61f3 commit f610804
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions app-insights.tf
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
resource "azurerm_application_insights" "appinsights" {
name = "${var.product}-${var.env}"
module "application_insights" {
source = "git@github.com:hmcts/terraform-module-application-insights?ref=main"

env = var.env
product = var.product

location = azurerm_resource_group.opal_resource_group.location
resource_group_name = azurerm_resource_group.opal_resource_group.name
application_type = "web"
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,
]
}
common_tags = var.common_tags
}

moved {
from = azurerm_application_insights.appinsights
to = module.application_insights.azurerm_application_insights.this
}

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.opal_key_vault.key_vault_id
}

resource "azurerm_key_vault_secret" "azure_appinsights_key" {
name = "AppInsightsInstrumentationKey"
value = azurerm_application_insights.appinsights.instrumentation_key
value = module.application_insights.instrumentation_key
key_vault_id = module.opal_key_vault.key_vault_id
}

0 comments on commit f610804

Please sign in to comment.