Skip to content

Create a vNet with any number of subnets. Optionally associate NSGs. Supports custom DNS and standard DDOS. Specify a hub vNet resourceId to create a spoke.

License

Notifications You must be signed in to change notification settings

terraform-azurerm-modules/terraform-azurerm-vnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-azurerm-vnet

Note that this repo may be deprecated as it does not give much more than the standard azurerm providers.

Description

This Terraform module deploys a vNet with any number of subnets.

You can also:

  • assign custom DNS servers

  • use the standard DDOS protection plan (see pricing)

  • associate Network Security Groups (NSGs) to subnets

  • add service endpoints to subnets

  • specify a hub vNet resourceId to peer as a spoke vNet

  • specify a default route IP address to configure a Route Table associated with all subnets

If you are overriding the system routing tables with more complex configurations then please use the native azurerm_route, azurerm_route_table and azurerm_subnet_route_table_association resource types.

Usage

Simple Hub Example

provider "azurerm" {
  version = "~> 2.11.0"
  features {}
}

resource "azurerm_resource_group" "test" {
  name     = "myTestResourceGroup"
  location = "West Europe"

  tags     = {
    environment = "dev"
    costcenter  = "it"
  }
}

module "network" {
  source                 = "github.com/terraform-azurerm-modules/terraform-azure-vnet"
  resource_group         = azurerm_resource_group.test.name
  location               = azurerm_resource_group.test.location
  tags                   = azurerm_resource_group.test.tags

  vnet_name              = "hub"
  address_space          = [ "10.0.0.0/24" ]
  dns_servers            = [ "10.0.0.68", "10.0.0.69" ]

  subnets                = {
    AzureFirewallSubnet  = "10.0.0.0/26"
    SharedServices       = "10.0.0.64/26"
    AzureBastionSubnet   = "10.0.0.192/27"
    GatewaySubnet        = "10.0.0.224/27"
  }
}

output "vnet" {
  value       = module.network.vnet
  description = "The module's vnet object."
}

output "subnets" {
  value       = module.network.subnets
  description = "The module's subnets object."
}

Authors

Originally created by Richard Cheney

License

MIT

About

Create a vNet with any number of subnets. Optionally associate NSGs. Supports custom DNS and standard DDOS. Specify a hub vNet resourceId to create a spoke.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages