Skip to content

Commit

Permalink
Merge pull request #303 from DFE-Digital/tf-fix-tags
Browse files Browse the repository at this point in the history
Fix tags in Terraform so plan is consistent
  • Loading branch information
albal authored Oct 13, 2023
2 parents 3e750fc + 976fbe0 commit e2ae6d8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Terraform/application.tf
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,6 @@ resource "azurerm_monitor_autoscale_setting" "autoscale" {
}
}
}

tags = data.azurerm_resource_group.rg.tags
}
14 changes: 14 additions & 0 deletions Terraform/private-endpoint.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e2ae6d8

Please sign in to comment.