Skip to content

devwithkrishna/azure-virtual-network-terraform-module

Repository files navigation

AZURE VIRTUAL NETWORK TERRAFORM MODULE

Azure Virtual Network (VNet) is a foundational service in Microsoft Azure that enables secure communication between Azure resources, on-premises networks, and the internet. It provides isolation, segmentation, and control over network traffic, allowing you to define subnets, routing rules, and network security policies.

A Terraform module for Azure VNet simplifies the provisioning and management of VNets by encapsulating reusable configurations. It allows you to define parameters like resource group, location, CIDR blocks, and subnets, enabling consistent and efficient deployment of network infrastructure across environments.

Requirements

Name Version
terraform ~> 1.3
azurerm <= 4.0
random >= 3.1

Usage

Basic usage of this module is as follows:

  module "example" {
    	 source  = "<module-path>"
    
   # Optional variables
    	 application_name  = "devwithkrishna"
    	 environment  = "DEV"
    	 location  = "southindia"
    	 resource_group_name  = "test1"
    	 subnet_cidrs  = [
"10.247.0.0/25"
]
    	 temporary  = "TRUE"
    	 vnet_address_space  = [
"10.247.0.0/25"
]
    	 vnet_name  = "test1"
  }

Resources

Name Type
azurerm_network_security_group.nsg resource
azurerm_network_security_rule.port22 resource
azurerm_network_security_rule.port4243 resource
azurerm_network_security_rule.port80 resource
azurerm_network_security_rule.port8080 resource
azurerm_resource_group.rg resource
azurerm_subnet.subnet resource
azurerm_subnet_network_security_group_association.subnet2nsg resource
azurerm_virtual_network.vnet resource
azurerm_subscription.current data source

Inputs

Name Description Type Required
application_name Azure application name tag string no
environment Environment tag value in Azure string no
location Azure location string no
resource_group_name Azure Vnet resource group name string no
subnet_cidrs Azure Subnet Ip addresses list(string) no
temporary Temporary tag value in Azure string no
vnet_address_space Azure VNET address space list(string) no
vnet_name Azure Vnet name string no

Outputs

Name Description
current_subscription_display_name Subscription name
current_subscription_id Subscription id
vnet_address_range Azure Vnet address range
vnet_environment Azure Vnet environment tag value
vnet_location Azure Location
vnet_name Azure Virtual network name
vnet_resource_group_name Azure resource group name

About

Templated azure virtual network module

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages