hmcts / ia-shared-infrastructure

Immigration & Asylum shared infrastructure
0 stars 1 forks source link

DTSPO-15909 - migrated Application Insights #39

Closed cpareek closed 8 months ago

cpareek commented 8 months ago

Jira link (if applicable)

https://tools.hmcts.net/jira/browse/DTSPO-15909

Change description

Updating azurerm_application_insights resource and replacing it with module terraform-module-application-insights

This will allow us to migrate Classic Application Insights using https://github.com/hmcts/app-insights-migration-tool as Classic Application Insights will deprecated and will be retired in February 2024.

hmcts-jenkins-d-to-i[bot] commented 8 months ago

Plan Result

:warning: Resource Deletion will happen :warning:

This plan contains resource delete operation. Please check the plan result very carefully!

Plan: 1 to add, 6 to change, 1 to destroy.
Change Result (Click me) ```hcl # data.azurerm_key_vault.ia_key_vault will be read during apply # (depends on a resource or a module with changes pending) <= data "azurerm_key_vault" "ia_key_vault" { + access_policy = (known after apply) + enable_rbac_authorization = (known after apply) + enabled_for_deployment = (known after apply) + enabled_for_disk_encryption = (known after apply) + enabled_for_template_deployment = (known after apply) + id = (known after apply) + location = (known after apply) + name = "ia-aat" + network_acls = (known after apply) + public_network_access_enabled = (known after apply) + purge_protection_enabled = (known after apply) + resource_group_name = "ia-aat" + sku_name = (known after apply) + tags = (known after apply) + tenant_id = (known after apply) + vault_uri = (known after apply) } # data.azurerm_key_vault_secret.ia_support_email will be read during apply # (config refers to values not yet known) <= data "azurerm_key_vault_secret" "ia_support_email" { + content_type = (known after apply) + expiration_date = (known after apply) + id = (known after apply) + key_vault_id = (known after apply) + name = "ia-support-email" + not_before_date = (known after apply) + resource_id = (known after apply) + resource_versionless_id = (known after apply) + tags = (known after apply) + value = (sensitive value) + versionless_id = (known after apply) } # azurerm_resource_group.rg will be updated in-place ~ resource "azurerm_resource_group" "rg" { id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/ia-aat" name = "ia-aat" ~ tags = { - "BuiltFrom" = "https://github.com/HMCTS/ia-shared-infrastructure.git" - "application" = "immigration" - "businessArea" = "CFT" - "changeUrl" = "" - "contactSlackChannel" = "#ia-tech" - "environment" = "staging" - "lastUpdated" = "2022-08-24T14:58:01Z" - "managedBy" = "Immigration" } -> (known after apply) # (1 unchanged attribute hidden) } # module.application_insights.azurerm_application_insights.this will be updated in-place # (moved from azurerm_application_insights.appinsights) ~ resource "azurerm_application_insights" "this" { ~ daily_data_cap_in_gb = 100 -> 50 id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/ia-aat/providers/Microsoft.Insights/components/ia-aat" name = "ia-aat" ~ tags = { - "BuiltFrom" = "https://github.com/HMCTS/ia-shared-infrastructure.git" -> null "application" = "immigration" + "autoShutdown" = "true" + "builtFrom" = "https://github.com/HMCTS/ia-shared-infrastructure.git" "businessArea" = "CFT" - "changeUrl" = "" -> null "contactSlackChannel" = "#ia-tech" "environment" = "staging" "managedBy" = "Immigration" } + workspace_id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/oms-automation/providers/Microsoft.OperationalInsights/workspaces/hmcts-nonprod" # (14 unchanged attributes hidden) } # module.ia_key_vault.azurerm_key_vault.kv will be updated in-place ~ resource "azurerm_key_vault" "kv" { id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/ia-aat/providers/Microsoft.KeyVault/vaults/ia-aat" name = "ia-aat" ~ tags = { - "BuiltFrom" = "https://github.com/HMCTS/ia-shared-infrastructure.git" -> null "application" = "immigration" + "autoShutdown" = "true" + "builtFrom" = "https://github.com/HMCTS/ia-shared-infrastructure.git" "businessArea" = "CFT" - "changeUrl" = "" -> null "contactSlackChannel" = "#ia-tech" "environment" = "staging" "managedBy" = "Immigration" } # (13 unchanged attributes hidden) # (1 unchanged block hidden) } # module.ia_key_vault.azurerm_key_vault_access_policy.creator_access_policy will be updated in-place ~ resource "azurerm_key_vault_access_policy" "creator_access_policy" { id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/ia-aat/providers/Microsoft.KeyVault/vaults/ia-aat/objectId/ca6d5085-485a-417d-8480-c3cefa29df31" ~ key_permissions = [ # (13 unchanged elements hidden) "Verify", + "GetRotationPolicy", ] # (6 unchanged attributes hidden) } # module.ia_key_vault.azurerm_key_vault_access_policy.product_team_access_policy will be updated in-place ~ resource "azurerm_key_vault_access_policy" "product_team_access_policy" { ~ certificate_permissions = [ # (10 unchanged elements hidden) "DeleteIssuers", + "Recover", ] id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/ia-aat/providers/Microsoft.KeyVault/vaults/ia-aat/objectId/b16db4e7-5cd6-409a-9f10-632089d91ff5" ~ key_permissions = [ # (4 unchanged elements hidden) "Delete", + "Recover", ] ~ secret_permissions = [ # (2 unchanged elements hidden) "Delete", + "Recover", ] # (4 unchanged attributes hidden) } # module.ia_key_vault.azurerm_user_assigned_identity.managed_identity[0] will be updated in-place ~ resource "azurerm_user_assigned_identity" "managed_identity" { id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/managed-identities-aat-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ia-aat-mi" name = "ia-aat-mi" ~ tags = { - "BuiltFrom" = "https://github.com/HMCTS/ia-shared-infrastructure.git" -> null "application" = "immigration" + "autoShutdown" = "true" + "builtFrom" = "https://github.com/HMCTS/ia-shared-infrastructure.git" "businessArea" = "CFT" - "changeUrl" = "" -> null "contactSlackChannel" = "#ia-tech" "environment" = "staging" "managedBy" = "Immigration" } # (5 unchanged attributes hidden) } # module.iac-action-group.azurerm_resource_group_template_deployment.action-group will be created + resource "azurerm_resource_group_template_deployment" "action-group" { + deployment_mode = "Incremental" + id = (known after apply) + name = "ia-support" + output_content = (known after apply) + parameters_content = (sensitive value) + resource_group_name = "ia-aat" + template_content = jsonencode( { + "$schema" = "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" + contentVersion = "1.0.0.0" + parameters = { + actionGroupName = { + type = "string" } + emailReceiverAddress = { + metadata = { + description = "Email address of the receiver" } + type = "string" } + emailReceiverName = { + metadata = { + description = "Name of the email receiver" } + type = "string" } + location = { + defaultValue = "global" + type = "string" } + shortName = { + type = "string" } } + resources = [ + { + apiVersion = "2017-04-01" + location = "[parameters('location')]" + name = "[parameters('actionGroupName')]" + properties = { + emailReceivers = [ + { + emailAddress = "[parameters('emailReceiverAddress')]" + name = "[parameters('emailReceiverName')]" }, ] + enabled = true + groupShortName = "[parameters('shortName')]" + smsReceivers = [] + webhookReceivers = [] } + tags = {} + type = "microsoft.insights/actionGroups" }, ] } ) } # module.iac-action-group.azurerm_template_deployment.action-group will be destroyed # (because azurerm_template_deployment.action-group is not in configuration) - resource "azurerm_template_deployment" "action-group" { - deployment_mode = "Incremental" -> null - id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/ia-aat/providers/Microsoft.Resources/deployments/ia-support_aat" -> null - name = "ia-support_aat" -> null - outputs = {} -> null - parameters = { - "actionGroupName" = "ia-support" - "emailReceiverAddress" = "iac-support@hmcts.net" - "emailReceiverName" = "IAC Support Mailing List" - "location" = "global" - "shortName" = "ia-support" } -> null - resource_group_name = "ia-aat" -> null - template_body = jsonencode( { - "$schema" = "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" - contentVersion = "1.0.0.0" - parameters = { - actionGroupName = { - type = "string" } - emailReceiverAddress = { - metadata = { - description = "Email address of the receiver" } - type = "string" } - emailReceiverName = { - metadata = { - description = "Name of the email receiver" } - type = "string" } - location = { - defaultValue = "global" - type = "string" } - shortName = { - type = "string" } } - resources = [ - { - apiVersion = "2017-04-01" - location = "[parameters('location')]" - name = "[parameters('actionGroupName')]" - properties = { - emailReceivers = [ - { - emailAddress = "[parameters('emailReceiverAddress')]" - name = "[parameters('emailReceiverName')]" }, ] - enabled = true - groupShortName = "[parameters('shortName')]" - smsReceivers = [] - webhookReceivers = [] } - tags = {} - type = "microsoft.insights/actionGroups" }, ] } ) -> null } Plan: 1 to add, 6 to change, 1 to destroy. ```