This Terraform module deploys a Virtual Network in Azure and some optional associated resources including:
- One or more Subnets.
- One NAT Gateway.
- One Bastion Host.
- One Network Security Group and NSG Rules.
- One Route Table and Routes.
- One or more VNET Peerings.
You can choose to make use of the associated resource (NSG, Nat Gateway or Route Table) deployed by the module or make use of an external one by using the keyword "module" instead of the resource ID.
Name | Version |
---|---|
terraform | >= 1.3.1 |
azurerm | >= 3.25.0, < 4.0 |
Name | Version |
---|---|
azurerm | >= 3.25.0, < 4.0 |
No modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
bastion | Bastion to be attached to the vnet and its options, if not null a new Azure Bastion plus a Bastion Subnet will be created. | object({ |
null |
no |
location | The location/region where all resources will be created. Changing this forces a new resource to be created. | string |
n/a | yes |
nat_gateway | Map of azurerm_nat_gateway options, if not null a new azurerm_nat_gateway will be created | object({ |
null |
no |
network_security_group | Map of azurerm_network_security_group options, if not null a new azurerm_network_security_group will be created | object({ |
null |
no |
peerings | Map of peerings, the key is the name of the peering | map(object({ |
null |
no |
resource_group_name | The name of the resource group in which to create the virtual network. This module will NOT create a resource group. | string |
n/a | yes |
route_table | Map of azurerm_route_table options, if not null a new azurerm_route_table will be created | object({ |
null |
no |
subnet_delegations_actions | Unfortunately this variable has to be kept updated with the output of `az network vnet subnet list-available-delegations --location westeurope | jq 'to_entries | map( {(.value.serviceName) : .value.actions } ) | add'` Reason hashicorp/terraform-provider-azurerm#5975 |
subnets | Map defining the subnets to be deployed, the key is the name of the subnet while the value is a list of address spaces | map(object({ |
n/a | yes |
virtual_network_address_space | The address space used by the virtual network. | list(string) |
n/a | yes |
virtual_network_bgp_community | The BGP community attribute in format :. | string |
null |
no |
virtual_network_ddos_protection_plan | Service that provides DDoS mitigation, requires the ID of the plan | string |
null |
no |
virtual_network_dns_servers | List of IP addresses of DNS servers | list(string) |
[] |
no |
virtual_network_edge_zone | Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created. | string |
null |
no |
virtual_network_flow_timeout_in_minutes | The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes. | number |
null |
no |
virtual_network_name | The name of the virtual network. Changing this forces a new resource to be created. | string |
n/a | yes |
virtual_network_tags | Map of tags that will be applied to the virtual network resource | map(string) |
null |
no |
Name | Description |
---|---|
nat_gateway_id | Outputs the ID for azurerm_nat_gateway |
nat_gateway_resource_guid | Outputs the GUID for azurerm_nat_gateway |
network_security_group_id | Outputs the ID for azurerm_network_security_group |
network_security_rule_id | Outputs the list of azurerm_network_security_rule ids |
resource_group_name | The name of the resource group in which to create the virtual network. |
route_table_id | Outputs the ID for azurerm_route_table |
route_table_subnets | Outputs the collection of subnets associated with the route table. |
subnet_address_prefixes | Ouputs a maps in the form: [subnet_name = subnet_address_prefixes] |
subnet_id | Outputs a map in the form: {subnet_name = subnet_id} |
subnet_name | Outputs the list of subnet names |
virtual_network_address_space | The list of address spaces used by the virtual network. |
virtual_network_guid | The GUID of the virtual network. |
virtual_network_id | The virtual Network Configuration ID. |
virtual_network_location | The location/region where the virtual network is created. |
virtual_network_name | The name of the virtual network. |