Skip to content

blackbird-cloud/terraform-azurerm-vnet-peering

Repository files navigation

Terraform Azurerm Vnet Peering Module

Terraform module to create an Azure VNet peering

blackbird-logo

Example

module "vnet_peering" {
  source = "../"

  network_peerings = {
    non-prod-to-shared = {
      origin_resource_group_name  = "non-prod-rg"
      origin_virtual_network_name = "non-prod-vnet-name"
      remote_virtual_network_id   = "shared-vnet-id"
    }
    prod-to-shared = {
      origin_resource_group_name  = "prod-rg"
      origin_virtual_network_name = "prod-vnet-name"
      remote_virtual_network_id   = "shared-vnet-id"
    }
    shared-to-non-prod = {
      origin_resource_group_name  = "shared-rg"
      origin_virtual_network_name = "shared-vnet-name"
      remote_virtual_network_id   = "non-prod-vnet-id"
    }
    shared-to-prod = {
      origin_resource_group_name  = "shared-rg"
      origin_virtual_network_name = "shared-vnet-name"
      remote_virtual_network_id   = "prod-vnet-id"
    }
  }
}

Requirements

Name Version
terraform >= 1.2
azurerm ~> 3

Providers

Name Version
azurerm ~> 3

Resources

Name Type
azurerm_virtual_network_peering.default resource

Inputs

Name Description Type Default Required
allow_forwarded_traffic Controls if forwarded traffic from the VMs in the peered virtual network is allowed. bool false no
allow_virtual_network_access Controls if the VMs in the peered virtual network are allowed to access the VMs in the local virtual network. bool true no
network_peerings A map of network peerings to create.
map(object({
origin_resource_group_name = string
origin_virtual_network_name = string
remote_virtual_network_id = string
origin_is_gateway = bool
}))
{} no

Outputs

Name Description
peering_network_ids The IDs of the network peerings.

About

We are Blackbird Cloud, Amsterdam based cloud consultancy, and cloud management service provider. We help companies build secure, cost efficient, and scale-able solutions.

Checkout our other 👉 terraform modules

Copyright

Copyright © 2017-2024 Blackbird Cloud