Skip to content

claranet/terraform-azurerm-vnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Virtual Network

Changelog Notice Apache V2 License OpenTofu Registry

Common Azure module to generate an Azure virtual network.

Global versioning rule for Claranet Azure modules

Module version Terraform version OpenTofu version AzureRM version
>= 8.x.x Unverified 1.8.x >= 4.0
>= 7.x.x 1.3.x >= 3.0
>= 6.x.x 1.x >= 3.0
>= 5.x.x 0.15.x >= 2.0
>= 4.x.x 0.13.x / 0.14.x >= 2.0
>= 3.x.x 0.12.x >= 2.0
>= 2.x.x 0.12.x < 2.0
< 2.x.x 0.11.x < 2.0

Contributing

If you want to contribute to this repository, feel free to use our pre-commit git hook configuration which will help you automatically update and format some files for you by enforcing our Terraform code module best-practices.

More details are available in the CONTRIBUTING.md file.

Usage

This module is optimized to work with the Claranet terraform-wrapper tool which set some terraform variables in the environment needed by this module. More details about variables set by the terraform-wrapper available in the documentation.

⚠️ Since modules version v8.0.0, we do not maintain/check anymore the compatibility with Hashicorp Terraform. Instead, we recommend to use OpenTofu.

module "azure_virtual_network" {
  source  = "claranet/vnet/azurerm"
  version = "x.x.x"

  environment    = var.environment
  location       = module.azure_region.location
  location_short = module.azure_region.location_short
  client_name    = var.client_name
  stack          = var.stack

  resource_group_name = module.rg.name

  cidrs       = ["10.10.0.0/16"]
  dns_servers = ["10.0.0.4", "10.0.0.5"] # Can be empty if not used
}

Providers

Name Version
azurecaf ~> 1.2.28
azurerm ~> 4.0

Modules

No modules.

Resources

Name Type
azurerm_virtual_network.main resource
azurecaf_name.vnet data source

Inputs

Name Description Type Default Required
cidrs The address spaces that is used by the virtual network. list(string) n/a yes
client_name Client name/account used in naming. string n/a yes
custom_name Optional custom virtual network name. string "" no
default_tags_enabled Option to enable or disable default tags. bool true no
dns_servers List of IP addresses of DNS servers. list(string) [] no
environment Project environment. string n/a yes
extra_tags Extra tags to add. map(string) {} no
location Azure region to use. string n/a yes
location_short Short string for Azure location. string n/a yes
name_prefix Optional prefix for the generated name. string "" no
name_suffix Optional suffix for the generated name. string "" no
resource_group_name Resource group name. string n/a yes
stack Project stack name. string n/a yes

Outputs

Name Description
address_space Virtual network address space.
id Virtual network ID.
location Virtual network location.
name Virtual network name.
resource Virtual network resource object.

Related documentation

Microsoft Azure documentation: docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-overview