Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix global tags and updated documentation #54

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ End-to-end testing is not conducted on these modules, as they are individual com
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.0 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | ~> 3.61 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | ~> 4.3 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | ~> 3.61 |
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | ~> 4.3 |

## Resources

Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ variable "resource_group" {
type = string
default = null
}

variable "tags" {
description = "default tags to be used."
type = map(string)
default = {}
}
Loading