azure logo
Azure Classic v5.43.0, May 6 23

azure.network.VirtualNetworkPeering

Explore with Pulumi AI

Manages a virtual network peering which allows resources to access other resources in the linked virtual network.

Note

Virtual Network peerings cannot be created, updated or deleted concurrently.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = new Azure.Core.ResourceGroup("example", new()
    {
        Location = "West Europe",
    });

    var example_1VirtualNetwork = new Azure.Network.VirtualNetwork("example-1VirtualNetwork", new()
    {
        ResourceGroupName = example.Name,
        AddressSpaces = new[]
        {
            "10.0.1.0/24",
        },
        Location = example.Location,
    });

    var example_2VirtualNetwork = new Azure.Network.VirtualNetwork("example-2VirtualNetwork", new()
    {
        ResourceGroupName = example.Name,
        AddressSpaces = new[]
        {
            "10.0.2.0/24",
        },
        Location = example.Location,
    });

    var example_1VirtualNetworkPeering = new Azure.Network.VirtualNetworkPeering("example-1VirtualNetworkPeering", new()
    {
        ResourceGroupName = example.Name,
        VirtualNetworkName = example_1VirtualNetwork.Name,
        RemoteVirtualNetworkId = example_2VirtualNetwork.Id,
    });

    var example_2VirtualNetworkPeering = new Azure.Network.VirtualNetworkPeering("example-2VirtualNetworkPeering", new()
    {
        ResourceGroupName = example.Name,
        VirtualNetworkName = example_2VirtualNetwork.Name,
        RemoteVirtualNetworkId = example_1VirtualNetwork.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		_, err = network.NewVirtualNetwork(ctx, "example-1VirtualNetwork", &network.VirtualNetworkArgs{
			ResourceGroupName: example.Name,
			AddressSpaces: pulumi.StringArray{
				pulumi.String("10.0.1.0/24"),
			},
			Location: example.Location,
		})
		if err != nil {
			return err
		}
		_, err = network.NewVirtualNetwork(ctx, "example-2VirtualNetwork", &network.VirtualNetworkArgs{
			ResourceGroupName: example.Name,
			AddressSpaces: pulumi.StringArray{
				pulumi.String("10.0.2.0/24"),
			},
			Location: example.Location,
		})
		if err != nil {
			return err
		}
		_, err = network.NewVirtualNetworkPeering(ctx, "example-1VirtualNetworkPeering", &network.VirtualNetworkPeeringArgs{
			ResourceGroupName:      example.Name,
			VirtualNetworkName:     example_1VirtualNetwork.Name,
			RemoteVirtualNetworkId: example_2VirtualNetwork.ID(),
		})
		if err != nil {
			return err
		}
		_, err = network.NewVirtualNetworkPeering(ctx, "example-2VirtualNetworkPeering", &network.VirtualNetworkPeeringArgs{
			ResourceGroupName:      example.Name,
			VirtualNetworkName:     example_2VirtualNetwork.Name,
			RemoteVirtualNetworkId: example_1VirtualNetwork.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.VirtualNetworkPeering;
import com.pulumi.azure.network.VirtualNetworkPeeringArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new ResourceGroup("example", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        var example_1VirtualNetwork = new VirtualNetwork("example-1VirtualNetwork", VirtualNetworkArgs.builder()        
            .resourceGroupName(example.name())
            .addressSpaces("10.0.1.0/24")
            .location(example.location())
            .build());

        var example_2VirtualNetwork = new VirtualNetwork("example-2VirtualNetwork", VirtualNetworkArgs.builder()        
            .resourceGroupName(example.name())
            .addressSpaces("10.0.2.0/24")
            .location(example.location())
            .build());

        var example_1VirtualNetworkPeering = new VirtualNetworkPeering("example-1VirtualNetworkPeering", VirtualNetworkPeeringArgs.builder()        
            .resourceGroupName(example.name())
            .virtualNetworkName(example_1VirtualNetwork.name())
            .remoteVirtualNetworkId(example_2VirtualNetwork.id())
            .build());

        var example_2VirtualNetworkPeering = new VirtualNetworkPeering("example-2VirtualNetworkPeering", VirtualNetworkPeeringArgs.builder()        
            .resourceGroupName(example.name())
            .virtualNetworkName(example_2VirtualNetwork.name())
            .remoteVirtualNetworkId(example_1VirtualNetwork.id())
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example = azure.core.ResourceGroup("example", location="West Europe")
example_1_virtual_network = azure.network.VirtualNetwork("example-1VirtualNetwork",
    resource_group_name=example.name,
    address_spaces=["10.0.1.0/24"],
    location=example.location)
example_2_virtual_network = azure.network.VirtualNetwork("example-2VirtualNetwork",
    resource_group_name=example.name,
    address_spaces=["10.0.2.0/24"],
    location=example.location)
example_1_virtual_network_peering = azure.network.VirtualNetworkPeering("example-1VirtualNetworkPeering",
    resource_group_name=example.name,
    virtual_network_name=example_1_virtual_network.name,
    remote_virtual_network_id=example_2_virtual_network.id)
example_2_virtual_network_peering = azure.network.VirtualNetworkPeering("example-2VirtualNetworkPeering",
    resource_group_name=example.name,
    virtual_network_name=example_2_virtual_network.name,
    remote_virtual_network_id=example_1_virtual_network.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = new azure.core.ResourceGroup("example", {location: "West Europe"});
const example_1VirtualNetwork = new azure.network.VirtualNetwork("example-1VirtualNetwork", {
    resourceGroupName: example.name,
    addressSpaces: ["10.0.1.0/24"],
    location: example.location,
});
const example_2VirtualNetwork = new azure.network.VirtualNetwork("example-2VirtualNetwork", {
    resourceGroupName: example.name,
    addressSpaces: ["10.0.2.0/24"],
    location: example.location,
});
const example_1VirtualNetworkPeering = new azure.network.VirtualNetworkPeering("example-1VirtualNetworkPeering", {
    resourceGroupName: example.name,
    virtualNetworkName: example_1VirtualNetwork.name,
    remoteVirtualNetworkId: example_2VirtualNetwork.id,
});
const example_2VirtualNetworkPeering = new azure.network.VirtualNetworkPeering("example-2VirtualNetworkPeering", {
    resourceGroupName: example.name,
    virtualNetworkName: example_2VirtualNetwork.name,
    remoteVirtualNetworkId: example_1VirtualNetwork.id,
});
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  example-1VirtualNetwork:
    type: azure:network:VirtualNetwork
    properties:
      resourceGroupName: ${example.name}
      addressSpaces:
        - 10.0.1.0/24
      location: ${example.location}
  example-2VirtualNetwork:
    type: azure:network:VirtualNetwork
    properties:
      resourceGroupName: ${example.name}
      addressSpaces:
        - 10.0.2.0/24
      location: ${example.location}
  example-1VirtualNetworkPeering:
    type: azure:network:VirtualNetworkPeering
    properties:
      resourceGroupName: ${example.name}
      virtualNetworkName: ${["example-1VirtualNetwork"].name}
      remoteVirtualNetworkId: ${["example-2VirtualNetwork"].id}
  example-2VirtualNetworkPeering:
    type: azure:network:VirtualNetworkPeering
    properties:
      resourceGroupName: ${example.name}
      virtualNetworkName: ${["example-2VirtualNetwork"].name}
      remoteVirtualNetworkId: ${["example-1VirtualNetwork"].id}

Create VirtualNetworkPeering Resource

new VirtualNetworkPeering(name: string, args: VirtualNetworkPeeringArgs, opts?: CustomResourceOptions);
@overload
def VirtualNetworkPeering(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          allow_forwarded_traffic: Optional[bool] = None,
                          allow_gateway_transit: Optional[bool] = None,
                          allow_virtual_network_access: Optional[bool] = None,
                          name: Optional[str] = None,
                          remote_virtual_network_id: Optional[str] = None,
                          resource_group_name: Optional[str] = None,
                          triggers: Optional[Mapping[str, str]] = None,
                          use_remote_gateways: Optional[bool] = None,
                          virtual_network_name: Optional[str] = None)
@overload
def VirtualNetworkPeering(resource_name: str,
                          args: VirtualNetworkPeeringArgs,
                          opts: Optional[ResourceOptions] = None)
func NewVirtualNetworkPeering(ctx *Context, name string, args VirtualNetworkPeeringArgs, opts ...ResourceOption) (*VirtualNetworkPeering, error)
public VirtualNetworkPeering(string name, VirtualNetworkPeeringArgs args, CustomResourceOptions? opts = null)
public VirtualNetworkPeering(String name, VirtualNetworkPeeringArgs args)
public VirtualNetworkPeering(String name, VirtualNetworkPeeringArgs args, CustomResourceOptions options)
type: azure:network:VirtualNetworkPeering
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args VirtualNetworkPeeringArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args VirtualNetworkPeeringArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args VirtualNetworkPeeringArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VirtualNetworkPeeringArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args VirtualNetworkPeeringArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

VirtualNetworkPeering Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The VirtualNetworkPeering resource accepts the following input properties:

RemoteVirtualNetworkId string

The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.

VirtualNetworkName string

The name of the virtual network. Changing this forces a new resource to be created.

AllowForwardedTraffic bool

Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.

AllowGatewayTransit bool

Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to false.

AllowVirtualNetworkAccess bool

Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to true.

Name string

The name of the virtual network peering. Changing this forces a new resource to be created.

Triggers Dictionary<string, string>
UseRemoteGateways bool

Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.

RemoteVirtualNetworkId string

The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.

VirtualNetworkName string

The name of the virtual network. Changing this forces a new resource to be created.

AllowForwardedTraffic bool

Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.

AllowGatewayTransit bool

Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to false.

AllowVirtualNetworkAccess bool

Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to true.

Name string

The name of the virtual network peering. Changing this forces a new resource to be created.

Triggers map[string]string
UseRemoteGateways bool

Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.

remoteVirtualNetworkId String

The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.

resourceGroupName String

The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.

virtualNetworkName String

The name of the virtual network. Changing this forces a new resource to be created.

allowForwardedTraffic Boolean

Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.

allowGatewayTransit Boolean

Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to false.

allowVirtualNetworkAccess Boolean

Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to true.

name String

The name of the virtual network peering. Changing this forces a new resource to be created.

triggers Map<String,String>
useRemoteGateways Boolean

Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.

remoteVirtualNetworkId string

The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.

resourceGroupName string

The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.

virtualNetworkName string

The name of the virtual network. Changing this forces a new resource to be created.

allowForwardedTraffic boolean

Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.

allowGatewayTransit boolean

Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to false.

allowVirtualNetworkAccess boolean

Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to true.

name string

The name of the virtual network peering. Changing this forces a new resource to be created.

triggers {[key: string]: string}
useRemoteGateways boolean

Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.

remote_virtual_network_id str

The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.

resource_group_name str

The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.

virtual_network_name str

The name of the virtual network. Changing this forces a new resource to be created.

allow_forwarded_traffic bool

Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.

allow_gateway_transit bool

Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to false.

allow_virtual_network_access bool

Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to true.

name str

The name of the virtual network peering. Changing this forces a new resource to be created.

triggers Mapping[str, str]
use_remote_gateways bool

Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.

remoteVirtualNetworkId String

The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.

resourceGroupName String

The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.

virtualNetworkName String

The name of the virtual network. Changing this forces a new resource to be created.

allowForwardedTraffic Boolean

Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.

allowGatewayTransit Boolean

Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to false.

allowVirtualNetworkAccess Boolean

Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to true.

name String

The name of the virtual network peering. Changing this forces a new resource to be created.

triggers Map<String>
useRemoteGateways Boolean

Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.

Outputs

All input properties are implicitly available as output properties. Additionally, the VirtualNetworkPeering resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing VirtualNetworkPeering Resource

Get an existing VirtualNetworkPeering resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: VirtualNetworkPeeringState, opts?: CustomResourceOptions): VirtualNetworkPeering
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        allow_forwarded_traffic: Optional[bool] = None,
        allow_gateway_transit: Optional[bool] = None,
        allow_virtual_network_access: Optional[bool] = None,
        name: Optional[str] = None,
        remote_virtual_network_id: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        triggers: Optional[Mapping[str, str]] = None,
        use_remote_gateways: Optional[bool] = None,
        virtual_network_name: Optional[str] = None) -> VirtualNetworkPeering
func GetVirtualNetworkPeering(ctx *Context, name string, id IDInput, state *VirtualNetworkPeeringState, opts ...ResourceOption) (*VirtualNetworkPeering, error)
public static VirtualNetworkPeering Get(string name, Input<string> id, VirtualNetworkPeeringState? state, CustomResourceOptions? opts = null)
public static VirtualNetworkPeering get(String name, Output<String> id, VirtualNetworkPeeringState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AllowForwardedTraffic bool

Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.

AllowGatewayTransit bool

Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to false.

AllowVirtualNetworkAccess bool

Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to true.

Name string

The name of the virtual network peering. Changing this forces a new resource to be created.

RemoteVirtualNetworkId string

The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.

Triggers Dictionary<string, string>
UseRemoteGateways bool

Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.

VirtualNetworkName string

The name of the virtual network. Changing this forces a new resource to be created.

AllowForwardedTraffic bool

Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.

AllowGatewayTransit bool

Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to false.

AllowVirtualNetworkAccess bool

Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to true.

Name string

The name of the virtual network peering. Changing this forces a new resource to be created.

RemoteVirtualNetworkId string

The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.

Triggers map[string]string
UseRemoteGateways bool

Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.

VirtualNetworkName string

The name of the virtual network. Changing this forces a new resource to be created.

allowForwardedTraffic Boolean

Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.

allowGatewayTransit Boolean

Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to false.

allowVirtualNetworkAccess Boolean

Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to true.

name String

The name of the virtual network peering. Changing this forces a new resource to be created.

remoteVirtualNetworkId String

The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.

resourceGroupName String

The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.

triggers Map<String,String>
useRemoteGateways Boolean

Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.

virtualNetworkName String

The name of the virtual network. Changing this forces a new resource to be created.

allowForwardedTraffic boolean

Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.

allowGatewayTransit boolean

Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to false.

allowVirtualNetworkAccess boolean

Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to true.

name string

The name of the virtual network peering. Changing this forces a new resource to be created.

remoteVirtualNetworkId string

The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.

resourceGroupName string

The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.

triggers {[key: string]: string}
useRemoteGateways boolean

Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.

virtualNetworkName string

The name of the virtual network. Changing this forces a new resource to be created.

allow_forwarded_traffic bool

Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.

allow_gateway_transit bool

Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to false.

allow_virtual_network_access bool

Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to true.

name str

The name of the virtual network peering. Changing this forces a new resource to be created.

remote_virtual_network_id str

The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.

resource_group_name str

The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.

triggers Mapping[str, str]
use_remote_gateways bool

Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.

virtual_network_name str

The name of the virtual network. Changing this forces a new resource to be created.

allowForwardedTraffic Boolean

Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.

allowGatewayTransit Boolean

Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to false.

allowVirtualNetworkAccess Boolean

Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to true.

name String

The name of the virtual network peering. Changing this forces a new resource to be created.

remoteVirtualNetworkId String

The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.

resourceGroupName String

The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.

triggers Map<String>
useRemoteGateways Boolean

Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.

virtualNetworkName String

The name of the virtual network. Changing this forces a new resource to be created.

Import

Virtual Network Peerings can be imported using the resource id, e.g.

 $ pulumi import azure:network/virtualNetworkPeering:VirtualNetworkPeering examplePeering /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/virtualNetworks/myvnet1/virtualNetworkPeerings/myvnet1peering

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.