VNet Peering module can deploy these resources:
- azurerm_virtual_network_peering (required)
Example variables structure is located in variables.md.
Example use case is located in test-case/locals.tf.
You can also see changelog.
Terraform documentation:
WARNING: AzureRM provider had been updated to a new major version. Many breaking changes were implemented. See the providers guide for more information.
There are a few things you need to do to import resources into .tfstate. In the example below there are resources which can be imported within the module. You may need to modify these commands to the OS on which they will be running (Refer to the documentation for additional details).
- terraform import '
<path-to-module>
.azurerm_virtual_network_peering.virtual_network_peering["<vnet-name>
_<peering-name>
"]' '/subscriptions/<subscription-id>
/resourceGroups/<resource-group-name>
/providers/Microsoft.Network/virtualNetworks/<vnet-name>
/virtualNetworkPeerings/<peering-name>
'
NOTE:
<path-to-module>
is terraform logical path from root. e.g. module.vnet_peering
Output Name | Value | Comment |
---|---|---|
outputs | name | |
id |
Virtual Network Peering module contains 3 custom variables - hub_hub
, hub_spoke
and spoke_hub
. These variables automatically use and combine Terraform variables allow_virtual_network_access
, allow_forwarded_traffic
, allow_gateway_transit
and use_remote_gateways
. Set value of one of these custom variables to true to create a combination of Terraform variables as shown in the table bellow. If you just want to use Terraform variables, don't set any of these custom variables. Go to test-case/locals.tf to see how to use this.
This table shows which Terraform variables are used for each custom variable:
Custom Variable | Terraform Variable |
---|---|
hub_hub | allow_virtual_network_access, allow_forwarded_traffic, allow_gateway_transit |
hub_spoke | allow_virtual_network_access, allow_gateway_transit |
spoke_hub | allow_virtual_network_access, allow_forwarded_traffic, allow_gateway_transit |
We currently log no issues in this module.