forked from hmcts/ccd-shared-infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appinsights.tf
26 lines (23 loc) · 872 Bytes
/
appinsights.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
resource "azurerm_application_insights" "appinsights" {
name = "${var.product}-${var.env}"
location = var.location
resource_group_name = azurerm_resource_group.rg.name
application_type = var.application_type
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,
]
}
}
output "appInsightsInstrumentationKey" {
sensitive = true
value = azurerm_application_insights.appinsights.instrumentation_key
}
resource "azurerm_key_vault_secret" "app_insights_key" {
name = "AppInsightsInstrumentationKey"
value = azurerm_application_insights.appinsights.instrumentation_key
key_vault_id = module.vault.key_vault_id
}