Skip to content

Commit

Permalink
fix: routing intent updated variable naming (#235)
Browse files Browse the repository at this point in the history
* updated variable naming

* update docs

* updated unit test virtual network

---------

Co-authored-by: Koen Rottiers <[email protected]>
  • Loading branch information
krottiers and Koen Rottiers authored Aug 2, 2023
1 parent 5fba0cd commit 6f41b98
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -818,9 +818,9 @@ only one of the virtual networks should have `resource_group_creation_enabled` s
- `vwan_propagated_routetables_labels`: A list of labels of route tables to propagate to the virtual network. [optional - leave empty to use `["default"]`]
- `vwan_propagated_routetables_resource_ids`: A list of resource IDs of route tables to propagate to the virtual network. [optional - leave empty to use `defaultRouteTable` on hub]
- `vwan_security_configuration`: A map of security configuration values for VWAN hub connection - see below. [optional - default empty]
- `secure_internet_traffic`: Whether to forward internet-bound traffic to the destination specified in the routing policy. Not compatible with `vwan_routing_intent_enabled`. [optional - default `false`]
- `secure_private_traffic`: Whether to all internal traffic to the destination specified in the routing policy. Not compatible with `vwan_routing_intent_enabled`. [optional - default `false`]
- `hub_routing_intent_enabled`: Enable to use with a Virtual WAN hub with routing intent enabled. Routing intent on hub is configured outside this module. Not compatible with `secure_internet_traffic` or `secure_private_traffic`. [optional - default `false`]
- `secure_internet_traffic`: Whether to forward internet-bound traffic to the destination specified in the routing policy. Not compatible with `routing_intent_enabled`. [optional - default `false`]
- `secure_private_traffic`: Whether to all internal traffic to the destination specified in the routing policy. Not compatible with `routing_intent_enabled`. [optional - default `false`]
- `routing_intent_enabled`: Enable to use with a Virtual WAN hub with routing intent enabled. Routing intent on hub is configured outside this module. Not compatible with `secure_internet_traffic` or `secure_private_traffic`. [optional - default `false`]

### Tags

Expand Down
12 changes: 6 additions & 6 deletions modules/virtualnetwork/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ only one of the virtual networks should have `resource_group_creation_enabled` s
- `vwan_propagated_routetables_labels`: A list of labels of route tables to propagate to the virtual network. [optional - leave empty to use `["default"]`]
- `vwan_propagated_routetables_resource_ids`: A list of resource IDs of route tables to propagate to the virtual network. [optional - leave empty to use `defaultRouteTable` on hub]
- `vwan_security_configuration`: A map of security configuration values for VWAN hub connection - see below. [optional - default empty]
- `secure_internet_traffic`: Whether to forward internet-bound traffic to the destination specified in the routing policy. Not compatible with `vwan_routing_intent_enabled`. [optional - default `false`]
- `secure_private_traffic`: Whether to all internal traffic to the destination specified in the routing policy. Not compatible with `vwan_routing_intent_enabled`. [optional - default `false`]
- `hub_routing_intent_enabled`: Enable to use with a Virtual WAN hub with routing intent enabled. Routing intent on hub is configured outside this module. Not compatible with `secure_internet_traffic` or `secure_private_traffic`. [optional - default `false`]
- `secure_internet_traffic`: Whether to forward internet-bound traffic to the destination specified in the routing policy. Not compatible with `routing_intent_enabled`. [optional - default `false`]
- `secure_private_traffic`: Whether to all internal traffic to the destination specified in the routing policy. Not compatible with `routing_intent_enabled`. [optional - default `false`]
- `routing_intent_enabled`: Enable to use with a Virtual WAN hub with routing intent enabled. Routing intent on hub is configured outside this module. Not compatible with `secure_internet_traffic` or `secure_private_traffic`. [optional - default `false`]

### Tags

Expand Down Expand Up @@ -177,9 +177,9 @@ map(object({
vwan_propagated_routetables_labels = optional(list(string), [])
vwan_propagated_routetables_resource_ids = optional(list(string), [])
vwan_security_configuration = optional(object({
secure_internet_traffic = optional(bool, false)
secure_private_traffic = optional(bool, false)
hub_routing_intent_enabled = optional(bool, false)
secure_internet_traffic = optional(bool, false)
secure_private_traffic = optional(bool, false)
routing_intent_enabled = optional(bool, false)
}), {})
tags = optional(map(string), {})
Expand Down
2 changes: 1 addition & 1 deletion modules/virtualnetwork/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ resource "azapi_resource" "vhubconnection" {
remoteVirtualNetwork = {
id = local.virtual_network_resource_ids[each.key]
}
routingConfiguration = each.value.vwan_security_configuration.hub_routing_intent_enabled ? null : {
routingConfiguration = each.value.vwan_security_configuration.routing_intent_enabled ? null : {
associatedRouteTable = {
id = each.value.vwan_associated_routetable_resource_id != "" ? each.value.vwan_associated_routetable_resource_id : "${each.value.vwan_hub_resource_id}/hubRouteTables/defaultRouteTable"
}
Expand Down
12 changes: 6 additions & 6 deletions modules/virtualnetwork/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ variable "virtual_networks" {
vwan_propagated_routetables_labels = optional(list(string), [])
vwan_propagated_routetables_resource_ids = optional(list(string), [])
vwan_security_configuration = optional(object({
secure_internet_traffic = optional(bool, false)
secure_private_traffic = optional(bool, false)
hub_routing_intent_enabled = optional(bool, false)
secure_internet_traffic = optional(bool, false)
secure_private_traffic = optional(bool, false)
routing_intent_enabled = optional(bool, false)
}), {})

tags = optional(map(string), {})
Expand Down Expand Up @@ -125,9 +125,9 @@ only one of the virtual networks should have `resource_group_creation_enabled` s
- `vwan_propagated_routetables_labels`: A list of labels of route tables to propagate to the virtual network. [optional - leave empty to use `["default"]`]
- `vwan_propagated_routetables_resource_ids`: A list of resource IDs of route tables to propagate to the virtual network. [optional - leave empty to use `defaultRouteTable` on hub]
- `vwan_security_configuration`: A map of security configuration values for VWAN hub connection - see below. [optional - default empty]
- `secure_internet_traffic`: Whether to forward internet-bound traffic to the destination specified in the routing policy. Not compatible with `vwan_routing_intent_enabled`. [optional - default `false`]
- `secure_private_traffic`: Whether to all internal traffic to the destination specified in the routing policy. Not compatible with `vwan_routing_intent_enabled`. [optional - default `false`]
- `hub_routing_intent_enabled`: Enable to use with a Virtual WAN hub with routing intent enabled. Routing intent on hub is configured outside this module. Not compatible with `secure_internet_traffic` or `secure_private_traffic`. [optional - default `false`]
- `secure_internet_traffic`: Whether to forward internet-bound traffic to the destination specified in the routing policy. Not compatible with `routing_intent_enabled`. [optional - default `false`]
- `secure_private_traffic`: Whether to all internal traffic to the destination specified in the routing policy. Not compatible with `routing_intent_enabled`. [optional - default `false`]
- `routing_intent_enabled`: Enable to use with a Virtual WAN hub with routing intent enabled. Routing intent on hub is configured outside this module. Not compatible with `secure_internet_traffic` or `secure_private_traffic`. [optional - default `false`]
### Tags
Expand Down
2 changes: 1 addition & 1 deletion tests/virtualnetwork/virtualnetwork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ func TestVirtualNetworkCreateValidWithVhubRoutingIntentEnabled(t *testing.T) {
primaryvnet["vwan_hub_resource_id"] = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Network/virtualHubs/te.st-hub"
primaryvnet["vwan_connection_enabled"] = true
primaryvnet["vwan_security_configuration"] = map[string]any{
"hub_routing_intent_enabled": true,
"routing_intent_enabled": true,
}

test, err := setuptest.Dirs(moduleDir, "").WithVars(v).InitPlanShowWithPrepFunc(t, utils.AzureRmAndRequiredProviders)
Expand Down
6 changes: 3 additions & 3 deletions variables.virtualnetwork.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ only one of the virtual networks should have `resource_group_creation_enabled` s
- `vwan_propagated_routetables_labels`: A list of labels of route tables to propagate to the virtual network. [optional - leave empty to use `["default"]`]
- `vwan_propagated_routetables_resource_ids`: A list of resource IDs of route tables to propagate to the virtual network. [optional - leave empty to use `defaultRouteTable` on hub]
- `vwan_security_configuration`: A map of security configuration values for VWAN hub connection - see below. [optional - default empty]
- `secure_internet_traffic`: Whether to forward internet-bound traffic to the destination specified in the routing policy. Not compatible with `vwan_routing_intent_enabled`. [optional - default `false`]
- `secure_private_traffic`: Whether to all internal traffic to the destination specified in the routing policy. Not compatible with `vwan_routing_intent_enabled`. [optional - default `false`]
- `hub_routing_intent_enabled`: Enable to use with a Virtual WAN hub with routing intent enabled. Routing intent on hub is configured outside this module. Not compatible with `secure_internet_traffic` or `secure_private_traffic`. [optional - default `false`]
- `secure_internet_traffic`: Whether to forward internet-bound traffic to the destination specified in the routing policy. Not compatible with `routing_intent_enabled`. [optional - default `false`]
- `secure_private_traffic`: Whether to all internal traffic to the destination specified in the routing policy. Not compatible with `routing_intent_enabled`. [optional - default `false`]
- `routing_intent_enabled`: Enable to use with a Virtual WAN hub with routing intent enabled. Routing intent on hub is configured outside this module. Not compatible with `secure_internet_traffic` or `secure_private_traffic`. [optional - default `false`]
### Tags
Expand Down

0 comments on commit 6f41b98

Please sign in to comment.