From 6ed90ab94693e66b284944c81f70d88ee27351a0 Mon Sep 17 00:00:00 2001 From: Gillian Stravers Date: Tue, 10 Dec 2024 09:48:51 +0100 Subject: [PATCH 1/2] publish --- main.tf | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index a54e647..aaeebca 100644 --- a/main.tf +++ b/main.tf @@ -1,14 +1,25 @@ # This Terraform configuration defines resources and a module for deploying an Azure Virtual WAN setup. - resource "azurerm_resource_group" "this" { name = var.resource_group.name location = var.resource_group.location + tags = merge( + try(var.tags), + tomap({ + "Resource Type" = "Resource Group" + }) + ) } resource "azurerm_virtual_wan" "this" { name = var.virtual_wan.name resource_group_name = azurerm_resource_group.this.name location = coalesce(var.virtual_wan.location, azurerm_resource_group.this.location) + tags = merge( + try(var.tags), + tomap({ + "Resource Type" = "Resource Group" + }) + ) } module "vhub" { @@ -17,4 +28,10 @@ module "vhub" { virtual_hubs = var.virtual_hubs[each.key] virtual_wan_id = azurerm_virtual_wan.this.id resource_group_name = azurerm_resource_group.this.name -} \ No newline at end of file + tags = merge( + try(var.tags), + tomap({ + "Resource Type" = "Resource Group" + }) + ) +} From 91fcd913025fa8849b3a2631e626a35879783ef2 Mon Sep 17 00:00:00 2001 From: Gillian Stravers Date: Tue, 10 Dec 2024 09:59:32 +0100 Subject: [PATCH 2/2] change tag values --- main.tf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.tf b/main.tf index aaeebca..15daaae 100644 --- a/main.tf +++ b/main.tf @@ -17,7 +17,7 @@ resource "azurerm_virtual_wan" "this" { tags = merge( try(var.tags), tomap({ - "Resource Type" = "Resource Group" + "Resource Type" = "Virtual WAN" }) ) } @@ -31,7 +31,6 @@ module "vhub" { tags = merge( try(var.tags), tomap({ - "Resource Type" = "Resource Group" }) ) }