https://github.com/aztfm/terraform-azurerm-virtual-network
Terraform module for Microsoft Azure to manage Virtual Network resource.
https://github.com/aztfm/terraform-azurerm-virtual-network
azure azure-resource-manager terraform terraform-module virtual-network
Last synced: about 1 month ago
JSON representation
Terraform module for Microsoft Azure to manage Virtual Network resource.
- Host: GitHub
- URL: https://github.com/aztfm/terraform-azurerm-virtual-network
- Owner: aztfm
- License: mit
- Created: 2020-11-03T12:55:58.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-01-09T22:30:53.000Z (almost 2 years ago)
- Last Synced: 2024-01-09T23:30:05.686Z (almost 2 years ago)
- Topics: azure, azure-resource-manager, terraform, terraform-module, virtual-network
- Language: HCL
- Homepage: https://registry.terraform.io/modules/aztfm/virtual-network/azurerm/
- Size: 94.7 KB
- Stars: 6
- Watchers: 2
- Forks: 11
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Azure Virtual Network - Terraform Module
[devcontainer]: https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/aztfm/terraform-azurerm-virtual-network
[registry]: https://registry.terraform.io/modules/aztfm/virtual-network/azurerm/
[releases]: https://github.com/aztfm/terraform-azurerm-virtual-network/releases[](https://github.com/pre-commit/pre-commit)
[][registry]
[][devcontainer]
[](LICENSE)
[][releases][](https://codespaces.new/aztfm/terraform-azurerm-virtual-network?quickstart=1)
## :gear: Version compatibility
| Module version | Terraform version | AzureRM version |
| -------------- | ----------------- | --------------- |
| >= 5.x.x | >= 1.9.x | >= 4.27.0 |
| >= 4.x.x | >= 1.3.x | >= 3.58.0 |
| >= 3.x.x | >= 1.3.x | >= 3.28.0 |
| >= 2.x.x | >= 0.13.x | >= 2.36.0 |
| >= 1.x.x | >= 0.13.x | >= 2.8.0 |## :memo: Usage
```hcl
resource "azurerm_resource_group" "rg" {
name = "resource-group"
location = "Spain Central"
}module "virtual_network" {
source = "aztfm/virtual-network/azurerm"
version = ">=5.0.0"
name = "virtual-network"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
address_space = ["10.0.0.0/16"]
subnets = [{
name = "subnet"
address_prefixes = ["10.0.0.0/24"]
}]
}
```Reference to more [examples](https://github.com/aztfm/terraform-azurerm-virtual-network/tree/main/examples).
## :arrow_forward: Parameters
The following parameters are supported:
| Name | Description | Type | Default | Required |
| ---- | ----------- | :--: | :-----: | :------: |
|name|The name of the virtual network.|`string`|n/a|yes|
|resource\_group\_name|The name of the resource group in which to create the virtual network.|`string`|n/a|yes|
|location|The location/region where the virtual network is created.|`string`|n/a|yes|
|tags|A mapping of tags to assign to the resource.|`map(string)`|`{}`|no|
|address\_space|The address space that is used in the virtual network. More than one address space can be provisioned.|`list(string)`|n/a|yes|
|dns\_servers|List of IP addresses of DNS servers.|`list(string)`|`[]`|no|
|ddos\_protection\_plan\_id|The ID of DDoS Protection Plan.|`string`|`null`|no|
|bgp\_community|The BGP community attribute in format `:`. The as-number segment is the Microsoft ASN, which is always 12076 for now.|`string`|`null`|no|
|encryption\_mode|The encryption mode for the virtual network. Possible values are 'AllowUnencrypted' or 'DropUnencrypted'.|`string`|`null`|no|
|subnets|List of objects that represent the configuration of each subnet.|`list(object({}))`|`[]`|no|The `subnets` supports the following:
| Name | Description | Type | Default | Required |
| ---- | ------------| :--: | :-----: | :------: |
|name|The name of the subnet.|`string`|n/a|yes|
|address\_prefixes|The address prefix/es to use for the subnet.|`list(string)`|n/a|yes|
|default\_outbound\_access\_enabled|Enable default outbound access to the internet for the subnet.|`bool`|`false`|no|
|service\_endpoints|The list of Service endpoints to associate with the subnet. Possible values include: `Microsoft.AzureActiveDirectory`, `Microsoft.AzureCosmosDB`, `Microsoft.ContainerRegistry`, `Microsoft.EventHub`, `Microsoft.KeyVault`, `Microsoft.ServiceBus`, `Microsoft.Sql`, `Microsoft.Storage`, `Microsoft.Storage.Global` and `Microsoft.Web`.|`string`|`null`|no|
|delegation|The name of service to delegate to. Possible values include: `GitHub.Network/networkSettings`, `Informatica.DataManagement/organizations`, `Microsoft.ApiManagement/service`, `Microsoft.Apollo/npu`, `Microsoft.App/environments`, `Microsoft.App/testClients`, `Microsoft.AVS/PrivateClouds`, `Microsoft.AzureCosmosDB/clusters`, `Microsoft.BareMetal/AzureHostedService`, `Microsoft.BareMetal/AzureVMware`, `Microsoft.BareMetal/CrayServers`, `Microsoft.Batch/batchAccounts`, `Microsoft.CloudTest/hostedpools`, `Microsoft.CloudTest/images`, `Microsoft.CloudTest/pools`, `Microsoft.Codespaces/plans`, `Microsoft.ContainerInstance/containerGroups`, `Microsoft.ContainerService/managedClusters`, `Microsoft.Databricks/workspaces`, `Microsoft.DBforMySQL/flexibleServers`, `Microsoft.DBforMySQL/servers`, `Microsoft.DBforMySQL/serversv2`, `Microsoft.DBforPostgreSQL/flexibleServers`, `Microsoft.DBforPostgreSQL/serversv2`, `Microsoft.DBforPostgreSQL/singleServers`, `Microsoft.DelegatedNetwork/controller`, `Microsoft.DevCenter/networkConnection`, `Microsoft.DevOpsInfrastructure/pools`, `Microsoft.DocumentDB/cassandraClusters`, `Microsoft.Fidalgo/networkSettings`, `Microsoft.HardwareSecurityModules/dedicatedHSMs`, `Microsoft.Kusto/clusters`, `Microsoft.LabServices/labplans`, `Microsoft.Logic/integrationServiceEnvironments`, `Microsoft.MachineLearningServices/workspaces`, `Microsoft.Netapp/volumes`, `Microsoft.Network/applicationGateways`, `Microsoft.Network/dnsResolvers`, `Microsoft.Network/networkWatchers`, `Microsoft.Orbital/orbitalGateways`, `Microsoft.PowerAutomate/hostedRpa`, `Microsoft.PowerPlatform/enterprisePolicies`, `Microsoft.PowerPlatform/vnetaccesslinks`, `Microsoft.ServiceFabricMesh/networks`, `Microsoft.ServiceNetworking/trafficControllers`, `Microsoft.Singularity/accounts/networks`, `Microsoft.Singularity/accounts/npu`, `Microsoft.Sql/managedInstances`, `Microsoft.StoragePool/diskPools`, `Microsoft.StreamAnalytics/streamingJobs`, `Microsoft.Synapse/workspaces`, `Microsoft.Web/hostingEnvironments`, `Microsoft.Web/serverFarms`, `NGINX.NGINXPLUS/nginxDeployments`, `PaloAltoNetworks.Cloudngfw/firewalls`, `Qumulo.Storage/fileSystems` and `Oracle.Database/networkAttachments`.|`string`|`null`|no|
|private\_endpoint\_network\_policies|Enable or Disable network policies for the private endpoint on the subnet. Possible values include: `Disabled`, `Enabled`, `NetworkSecurityGroupEnabled` and `RouteTableEnabled`.|`string`|`Disabled`|no|
|private\_link\_service\_network\_policies\_enabled|Enable or Disable network policies for the private link service on the subnet.|`bool`|`false`|no|## :arrow_backward: Outputs
The following outputs are exported:
| Name | Description | Sensitive |
| ---- | ------------| :-------: |
|id|The virtual network configuration ID.|no|
|guid|The GUID of the virtual network.|no|
|name|The name of the virtual network.|no|
|resource_group_name|The name of the resource group in which to create the virtual network.|no|
|location|The location/region where the virtual network is created.|no|
|tags|The tags assigned to the resource.|no|
|address_space|The list of address spaces used by the virtual network.|no|
|dns_servers|The list of DNS servers used by the virtual network.|no|
|ddos_protection_plan|Block containing configuration of ddos protection plan.|no|
|subnets|Blocks containing configuration of each subnet.|no|