diff --git a/README.md b/README.md
index 835cbdb..2a17430 100644
--- a/README.md
+++ b/README.md
@@ -36,13 +36,13 @@ End-to-end testing is not conducted on these modules, as they are individual com
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | ~> 1.0 |
-| [azurerm](#requirement\_azurerm) | ~> 3.61 |
+| [azurerm](#requirement\_azurerm) | ~> 4.3 |
## Providers
| Name | Version |
|------|---------|
-| [azurerm](#provider\_azurerm) | ~> 3.61 |
+| [azurerm](#provider\_azurerm) | ~> 4.3 |
## Resources
@@ -63,6 +63,7 @@ End-to-end testing is not conducted on these modules, as they are individual com
| `naming` | contains naming convention | string | yes |
| `location` | default azure region and can be used if location is not specified inside the object | string | no |
| `resource_group` | default resource group and can be used if resourcegroup is not specified inside the object | string | no |
+| `tags` | tags to be added to the resources | map(string) | no |
## Outputs
diff --git a/main.tf b/main.tf
index adc4e67..cba8717 100644
--- a/main.tf
+++ b/main.tf
@@ -7,7 +7,7 @@ resource "azurerm_virtual_wan" "vwan" {
disable_vpn_encryption = try(var.vwan.disable_vpn_encryption, false)
type = try(var.vwan.type, "Standard")
office365_local_breakout_category = try(var.vwan.office365_local_breakout_category, "None")
- tags = try(var.vwan.tags, {})
+ tags = try(var.vwan.tags, var.tags)
}
# vhubs
@@ -23,7 +23,7 @@ resource "azurerm_virtual_hub" "vhub" {
virtual_wan_id = azurerm_virtual_wan.vwan.id
sku = try(each.value.sku, "Standard")
hub_routing_preference = try(each.value.hub_routing_preference, "ExpressRoute")
- tags = try(each.value.tags, {})
+ tags = try(each.value.tags, var.tags)
}
# vpn gateway
@@ -37,7 +37,7 @@ resource "azurerm_vpn_gateway" "vpn_gateway" {
location = coalesce(lookup(each.value, "location", null), var.location)
virtual_hub_id = azurerm_virtual_hub.vhub[each.key].id
routing_preference = lookup(each.value.vpn_gateway, "routing_preference", null)
- tags = try(var.vwan.tags, {})
+ tags = try(var.vwan.tags, var.tags)
}
# vpn sites
@@ -61,7 +61,7 @@ resource "azurerm_vpn_site" "vpn_site" {
address_cidrs = [each.value.address_prefix]
device_vendor = try(each.value.device_vendor, "Microsoft")
device_model = try(each.value.device_model, "VpnSite")
- tags = try(var.vwan.tags, {})
+ tags = try(var.vwan.tags, var.tags)
dynamic "link" {
# minimal of one link is required
diff --git a/variables.tf b/variables.tf
index 108064c..1be6500 100644
--- a/variables.tf
+++ b/variables.tf
@@ -20,3 +20,9 @@ variable "resource_group" {
type = string
default = null
}
+
+variable "tags" {
+ description = "default tags to be used."
+ type = map(string)
+ default = {}
+}