{"id":49339533,"url":"https://github.com/citadel-cloud-management/terraform-azure-virtual-network","last_synced_at":"2026-04-27T03:03:11.675Z","repository":{"id":342913885,"uuid":"1175258805","full_name":"Citadel-Cloud-Management/terraform-azure-virtual-network","owner":"Citadel-Cloud-Management","description":"Azure Virtual Network Terraform module with subnets, NSGs, NAT Gateway, DDoS Protection, and private DNS","archived":false,"fork":false,"pushed_at":"2026-04-11T22:19:27.000Z","size":33,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-12T00:34:33.366Z","etag":null,"topics":["azure","devops","infrastructure-as-code","networking","production-ready","terraform","terraform-module","virtual-network"],"latest_commit_sha":null,"homepage":"https://citadel-cloud-management.github.io/terraform-azure-virtual-network/","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Citadel-Cloud-Management.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-07T13:12:33.000Z","updated_at":"2026-04-11T22:40:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Citadel-Cloud-Management/terraform-azure-virtual-network","commit_stats":null,"previous_names":["kogunlowo123/terraform-azure-virtual-network","citadel-cloud-management/terraform-azure-virtual-network"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Citadel-Cloud-Management/terraform-azure-virtual-network","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Citadel-Cloud-Management%2Fterraform-azure-virtual-network","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Citadel-Cloud-Management%2Fterraform-azure-virtual-network/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Citadel-Cloud-Management%2Fterraform-azure-virtual-network/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Citadel-Cloud-Management%2Fterraform-azure-virtual-network/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Citadel-Cloud-Management","download_url":"https://codeload.github.com/Citadel-Cloud-Management/terraform-azure-virtual-network/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Citadel-Cloud-Management%2Fterraform-azure-virtual-network/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32320686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","devops","infrastructure-as-code","networking","production-ready","terraform","terraform-module","virtual-network"],"created_at":"2026-04-27T03:03:05.653Z","updated_at":"2026-04-27T03:03:11.667Z","avatar_url":"https://github.com/Citadel-Cloud-Management.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Terraform](https://img.shields.io/badge/Terraform-%3E%3D1.5-blueviolet?logo=terraform)\n![Azure](https://img.shields.io/badge/Azure-0078D4?logo=microsoftazure\u0026logoColor=white)\n![License](https://img.shields.io/badge/License-MIT-green)\n![CI](https://img.shields.io/github/actions/workflow/status/kogunlowo123/terraform-azure-virtual-network/terraform-ci.yml?label=CI)\n![GitHub release](https://img.shields.io/github/v/release/kogunlowo123/terraform-azure-virtual-network)\n\n# Terraform Azure Virtual Network Module\n\nA comprehensive Terraform module for deploying Azure Virtual Networks with subnet delegation, service endpoints, NAT Gateway, DDoS Protection, Network Security Groups, NSG flow logs, and Private DNS Zones.\n\n## Architecture\n\n```\n                        +---------------------------+\n                        |   Azure Virtual Network   |\n                        |   (address_spaces)        |\n                        |                           |\n                        |  +--- DDoS Protection -+  |\n                        |  |    Plan (optional)   |  |\n                        |  +---------------------+  |\n                        +---------------------------+\n                                    |\n            +-----------------------+-----------------------+\n            |                       |                       |\n    +-------v-------+      +-------v-------+      +-------v-------+\n    |   Subnet 1    |      |   Subnet 2    |      |   Subnet N    |\n    | (delegation,  |      | (service      |      | (custom       |\n    |  endpoints)   |      |  endpoints)   |      |  config)      |\n    +-------+-------+      +-------+-------+      +-------+-------+\n            |                       |                       |\n    +-------v-------+      +-------v-------+      +-------v-------+\n    |     NSG       |      |     NSG       |      |     NSG       |\n    | (per-subnet   |      | (per-subnet   |      | (per-subnet   |\n    |  rules)       |      |  rules)       |      |  rules)       |\n    +-------+-------+      +-------+-------+      +-------+-------+\n            |                       |                       |\n            +-----------+-----------+-----------+-----------+\n                        |                       |\n                +-------v-------+       +-------v-----------+\n                |  NAT Gateway  |       | Private DNS Zones |\n                |  (optional)   |       | (optional)        |\n                |  + Public IPs |       | + VNet Links      |\n                +---------------+       +-------------------+\n                                                |\n                                        +-------v-----------+\n                                        | Private Endpoints |\n                                        | (submodule)       |\n                                        +-------------------+\n\n    +-------------------+       +-------------------+\n    |  VNet Peering     |       |  NSG Flow Logs    |\n    |  (submodule)      |       |  (optional)       |\n    +-------------------+       +-------------------+\n```\n\n### Component Diagram\n\n```mermaid\nflowchart TB\n    subgraph VNet[\"Azure Virtual Network\"]\n        VNET[\"VNet\\n(Address Spaces)\"]\n        DDOS[\"DDoS Protection\\nPlan\"]\n    end\n\n    subgraph Subnets[\"Subnets\"]\n        S1[\"Subnet 1\\n(Delegation)\"]\n        S2[\"Subnet 2\\n(Service Endpoints)\"]\n        SN[\"Subnet N\\n(Custom Config)\"]\n    end\n\n    subgraph NetworkSecurity[\"Network Security\"]\n        NSG1[\"NSG\\n(Per-Subnet Rules)\"]\n        FL[\"NSG Flow Logs\\n(Log Analytics)\"]\n    end\n\n    subgraph Connectivity[\"Connectivity\"]\n        NAT[\"NAT Gateway\\n(Public IPs)\"]\n        PEER[\"VNet Peering\\n(Bidirectional)\"]\n    end\n\n    subgraph DNS[\"Private DNS\"]\n        PDZ[\"Private DNS Zones\"]\n        VNL[\"VNet Links\"]\n        PE[\"Private Endpoints\"]\n    end\n\n    subgraph Routing[\"Route Tables\"]\n        RT[\"Custom Route\\nTables\"]\n        SE[\"Service Endpoints\\n(Microsoft.Storage, etc.)\"]\n    end\n\n    VNET --\u003e DDOS\n    VNET --\u003e S1\n    VNET --\u003e S2\n    VNET --\u003e SN\n    S1 --\u003e NSG1\n    S2 --\u003e NSG1\n    SN --\u003e NSG1\n    NSG1 --\u003e FL\n    S1 --\u003e NAT\n    S2 --\u003e NAT\n    VNET --\u003e PEER\n    PDZ --\u003e VNL\n    VNL --\u003e PE\n    S1 --\u003e RT\n    S2 --\u003e SE\n\n    style VNet fill:#0078D4,stroke:#0078D4,color:#fff\n    style Subnets fill:#FF9900,stroke:#FF9900,color:#fff\n    style NetworkSecurity fill:#DD344C,stroke:#DD344C,color:#fff\n    style Connectivity fill:#3F8624,stroke:#3F8624,color:#fff\n    style DNS fill:#8C4FFF,stroke:#8C4FFF,color:#fff\n    style Routing fill:#1A73E8,stroke:#1A73E8,color:#fff\n    style VNET fill:#0078D4,stroke:#005a9e,color:#fff\n    style DDOS fill:#0078D4,stroke:#005a9e,color:#fff\n    style S1 fill:#FF9900,stroke:#cc7a00,color:#fff\n    style S2 fill:#FF9900,stroke:#cc7a00,color:#fff\n    style SN fill:#FF9900,stroke:#cc7a00,color:#fff\n    style NSG1 fill:#DD344C,stroke:#b02a3d,color:#fff\n    style FL fill:#DD344C,stroke:#b02a3d,color:#fff\n    style NAT fill:#3F8624,stroke:#2d6119,color:#fff\n    style PEER fill:#3F8624,stroke:#2d6119,color:#fff\n    style PDZ fill:#8C4FFF,stroke:#6b3dcc,color:#fff\n    style VNL fill:#8C4FFF,stroke:#6b3dcc,color:#fff\n    style PE fill:#8C4FFF,stroke:#6b3dcc,color:#fff\n    style RT fill:#1A73E8,stroke:#1459b3,color:#fff\n    style SE fill:#1A73E8,stroke:#1459b3,color:#fff\n```\n\n## Features\n\n- **Virtual Network** with multiple address spaces and custom DNS servers\n- **Subnets** with configurable address prefixes, service endpoints, and delegation\n- **Network Security Groups** per subnet with flexible rule definitions\n- **NAT Gateway** with configurable public IP count and idle timeout\n- **DDoS Protection** plan association\n- **NSG Flow Logs** with Log Analytics traffic analytics integration\n- **Private DNS Zones** with automatic VNet linking\n- **Submodules** for subnets, private endpoints, and VNet peering\n\n## Usage\n\n### Basic\n\n```hcl\nmodule \"vnet\" {\n  source  = \"kogunlowo123/virtual-network/azure\"\n  version = \"~\u003e 1.0\"\n\n  name                = \"my-vnet\"\n  resource_group_name = \"my-resource-group\"\n  location            = \"eastus\"\n  address_spaces      = [\"10.0.0.0/16\"]\n\n  subnets = {\n    \"frontend\" = {\n      address_prefixes = [\"10.0.1.0/24\"]\n    }\n    \"backend\" = {\n      address_prefixes = [\"10.0.2.0/24\"]\n    }\n  }\n\n  tags = {\n    Environment = \"dev\"\n  }\n}\n```\n\n### With NAT Gateway and NSG Rules\n\n```hcl\nmodule \"vnet\" {\n  source  = \"kogunlowo123/virtual-network/azure\"\n  version = \"~\u003e 1.0\"\n\n  name                = \"prod-vnet\"\n  resource_group_name = \"prod-rg\"\n  location            = \"eastus\"\n  address_spaces      = [\"10.0.0.0/16\"]\n\n  subnets = {\n    \"web\" = {\n      address_prefixes  = [\"10.0.1.0/24\"]\n      service_endpoints = [\"Microsoft.Storage\"]\n      nsg_rules = [\n        {\n          name                   = \"allow-https\"\n          priority               = 100\n          direction              = \"Inbound\"\n          access                 = \"Allow\"\n          protocol               = \"Tcp\"\n          destination_port_range = \"443\"\n        }\n      ]\n    }\n    \"app\" = {\n      address_prefixes = [\"10.0.2.0/24\"]\n      delegation = {\n        name                    = \"app-service\"\n        service_delegation_name = \"Microsoft.Web/serverFarms\"\n        actions                 = [\"Microsoft.Network/virtualNetworks/subnets/action\"]\n      }\n    }\n  }\n\n  enable_nat_gateway          = true\n  nat_gateway_public_ip_count = 2\n\n  tags = {\n    Environment = \"production\"\n  }\n}\n```\n\n### With Private DNS Zones\n\n```hcl\nmodule \"vnet\" {\n  source  = \"kogunlowo123/virtual-network/azure\"\n  version = \"~\u003e 1.0\"\n\n  name                = \"hub-vnet\"\n  resource_group_name = \"hub-rg\"\n  location            = \"eastus\"\n  address_spaces      = [\"10.0.0.0/16\"]\n\n  subnets = {\n    \"private-endpoints\" = {\n      address_prefixes = [\"10.0.4.0/24\"]\n    }\n  }\n\n  private_dns_zones = [\n    {\n      name = \"privatelink.blob.core.windows.net\"\n    },\n    {\n      name         = \"privatelink.database.windows.net\"\n      linked_vnets = [\"/subscriptions/.../spoke-vnet-id\"]\n    }\n  ]\n}\n```\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| [terraform](#requirement\\_terraform) | \u003e= 1.5.0 |\n| [azurerm](#requirement\\_azurerm) | \u003e= 3.80.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| [azurerm](#provider\\_azurerm) | \u003e= 3.80.0 |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|----------|\n| `name` | The name of the virtual network | `string` | n/a | yes |\n| `resource_group_name` | The name of the resource group | `string` | n/a | yes |\n| `location` | The Azure region for deployment | `string` | n/a | yes |\n| `address_spaces` | List of CIDR blocks for the VNet | `list(string)` | n/a | yes |\n| `dns_servers` | Custom DNS server IPs | `list(string)` | `[]` | no |\n| `subnets` | Map of subnet configuration objects | `map(object)` | `{}` | no |\n| `enable_nat_gateway` | Create a NAT Gateway | `bool` | `false` | no |\n| `nat_gateway_idle_timeout` | NAT Gateway idle timeout (minutes) | `number` | `4` | no |\n| `nat_gateway_public_ip_count` | Number of public IPs for NAT Gateway | `number` | `1` | no |\n| `enable_ddos_protection` | Enable DDoS Protection | `bool` | `false` | no |\n| `ddos_protection_plan_id` | DDoS Protection Plan ID | `string` | `null` | no |\n| `enable_flow_logs` | Enable NSG flow logs | `bool` | `false` | no |\n| `network_watcher_name` | Network Watcher name for flow logs | `string` | `null` | no |\n| `log_analytics_workspace_id` | Log Analytics Workspace ID | `string` | `null` | no |\n| `private_dns_zones` | List of private DNS zone objects | `list(object)` | `[]` | no |\n| `tags` | Tags to assign to all resources | `map(string)` | `{}` | no |\n\n### Subnet Object Structure\n\n```hcl\n{\n  address_prefixes  = list(string)           # Required\n  service_endpoints = optional(list(string)) # e.g., [\"Microsoft.Storage\"]\n  delegation = optional(object({\n    name                    = string\n    service_delegation_name = string\n    actions                 = optional(list(string))\n  }))\n  nsg_rules = optional(list(object({\n    name                       = string\n    priority                   = number\n    direction                  = string  # \"Inbound\" or \"Outbound\"\n    access                     = string  # \"Allow\" or \"Deny\"\n    protocol                   = string  # \"Tcp\", \"Udp\", \"Icmp\", or \"*\"\n    source_port_range          = optional(string, \"*\")\n    destination_port_range     = optional(string, \"*\")\n    source_address_prefix      = optional(string, \"*\")\n    destination_address_prefix = optional(string, \"*\")\n  })))\n}\n```\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| `vnet_id` | The ID of the virtual network |\n| `vnet_name` | The name of the virtual network |\n| `vnet_address_space` | The address space of the virtual network |\n| `vnet_guid` | The GUID of the virtual network |\n| `subnet_ids` | Map of subnet names to their resource IDs |\n| `subnet_address_prefixes` | Map of subnet names to their address prefixes |\n| `nsg_ids` | Map of subnet names to their NSG resource IDs |\n| `nat_gateway_id` | The ID of the NAT Gateway |\n| `nat_gateway_public_ips` | Public IPs of the NAT Gateway |\n| `private_dns_zone_ids` | Map of DNS zone names to their resource IDs |\n| `resource_group_name` | The name of the resource group |\n| `location` | The Azure region |\n\n## Submodules\n\n| Module | Description |\n|--------|-------------|\n| [subnet](./modules/subnet/) | Standalone subnet with NSG and delegation |\n| [private-endpoint](./modules/private-endpoint/) | Private Endpoint with DNS zone integration |\n| [vnet-peering](./modules/vnet-peering/) | Bidirectional VNet peering |\n\n## Examples\n\n- [Basic](./examples/basic/) - Simple VNet with two subnets\n- [Advanced](./examples/advanced/) - VNet with NSGs, NAT Gateway, and delegated subnets\n- [Complete](./examples/complete/) - Full-featured deployment with all options enabled\n\n## Azure References\n\n- [Azure Virtual Network documentation](https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-overview)\n- [Azure Subnet delegation](https://learn.microsoft.com/en-us/azure/virtual-network/subnet-delegation-overview)\n- [Azure NAT Gateway](https://learn.microsoft.com/en-us/azure/nat-gateway/nat-overview)\n- [Azure DDoS Protection](https://learn.microsoft.com/en-us/azure/ddos-protection/ddos-protection-overview)\n- [Azure NSG flow logs](https://learn.microsoft.com/en-us/azure/network-watcher/nsg-flow-logs-overview)\n- [Azure Private DNS zones](https://learn.microsoft.com/en-us/azure/dns/private-dns-overview)\n- [Azure Private Endpoints](https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-overview)\n- [Azure VNet peering](https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-peering-overview)\n\n## Contributing\n\nContributions are welcome. Please open an issue first to discuss what you would like to change.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcitadel-cloud-management%2Fterraform-azure-virtual-network","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcitadel-cloud-management%2Fterraform-azure-virtual-network","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcitadel-cloud-management%2Fterraform-azure-virtual-network/lists"}