From a5aa7a253330bb80d57b1ea77be0dfd200f6c756 Mon Sep 17 00:00:00 2001 From: Al West Date: Fri, 13 Oct 2023 10:29:04 +0100 Subject: [PATCH] Fix tags in Terraform so plan is consistent --- Terraform/application.tf | 2 ++ Terraform/private-endpoint.tf | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/Terraform/application.tf b/Terraform/application.tf index a832aa70..68711837 100644 --- a/Terraform/application.tf +++ b/Terraform/application.tf @@ -152,4 +152,6 @@ resource "azurerm_monitor_autoscale_setting" "autoscale" { } } } + + tags = data.azurerm_resource_group.rg.tags } diff --git a/Terraform/private-endpoint.tf b/Terraform/private-endpoint.tf index 7dabca5e..047a3e78 100644 --- a/Terraform/private-endpoint.tf +++ b/Terraform/private-endpoint.tf @@ -2,6 +2,13 @@ resource "azurerm_private_dns_zone" "dnsprivatezone" { name = "privatelink.azurewebsites.net" resource_group_name = data.azurerm_resource_group.rg.name + + tags = { + Environment = lookup(data.azurerm_resource_group.rg.tags, "Environment", "") + Portfolio = lookup(data.azurerm_resource_group.rg.tags, "Portfolio", "") + Product = lookup(data.azurerm_resource_group.rg.tags, "Product", "") + Service = lookup(data.azurerm_resource_group.rg.tags, "Service", "") + } } # Definition of the dns zone link @@ -10,6 +17,13 @@ resource "azurerm_private_dns_zone_virtual_network_link" "dnszonelink" { resource_group_name = data.azurerm_resource_group.rg.name private_dns_zone_name = azurerm_private_dns_zone.dnsprivatezone.name virtual_network_id = data.azurerm_virtual_network.vnet1.id + + tags = { + Environment = lookup(data.azurerm_resource_group.rg.tags, "Environment", "") + Portfolio = lookup(data.azurerm_resource_group.rg.tags, "Portfolio", "") + Product = lookup(data.azurerm_resource_group.rg.tags, "Product", "") + Service = lookup(data.azurerm_resource_group.rg.tags, "Service", "") + } } # Definition of the private end point for the web app