We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
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 Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var example = new Azure.Core.ResourceGroup("example", new Azure.Core.ResourceGroupArgs
{
Location = "West Europe",
});
var example_1VirtualNetwork = new Azure.Network.VirtualNetwork("example-1VirtualNetwork", new Azure.Network.VirtualNetworkArgs
{
ResourceGroupName = example.Name,
AddressSpaces =
{
"10.0.1.0/24",
},
Location = "West US",
});
var example_2VirtualNetwork = new Azure.Network.VirtualNetwork("example-2VirtualNetwork", new Azure.Network.VirtualNetworkArgs
{
ResourceGroupName = example.Name,
AddressSpaces =
{
"10.0.2.0/24",
},
Location = "West US",
});
var example_1VirtualNetworkPeering = new Azure.Network.VirtualNetworkPeering("example-1VirtualNetworkPeering", new Azure.Network.VirtualNetworkPeeringArgs
{
ResourceGroupName = example.Name,
VirtualNetworkName = example_1VirtualNetwork.Name,
RemoteVirtualNetworkId = example_2VirtualNetwork.Id,
});
var example_2VirtualNetworkPeering = new Azure.Network.VirtualNetworkPeering("example-2VirtualNetworkPeering", new Azure.Network.VirtualNetworkPeeringArgs
{
ResourceGroupName = example.Name,
VirtualNetworkName = example_2VirtualNetwork.Name,
RemoteVirtualNetworkId = example_1VirtualNetwork.Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v4/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: pulumi.String("West US"),
})
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: pulumi.String("West US"),
})
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
})
}
Example coming soon!
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: "West US",
});
const example_2VirtualNetwork = new azure.network.VirtualNetwork("example-2VirtualNetwork", {
resourceGroupName: example.name,
addressSpaces: ["10.0.2.0/24"],
location: "West US",
});
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,
});
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="West US")
example_2_virtual_network = azure.network.VirtualNetwork("example-2VirtualNetwork",
resource_group_name=example.name,
address_spaces=["10.0.2.0/24"],
location="West US")
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)
Example coming soon!
Create VirtualNetworkPeering Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VirtualNetworkPeering(name: string, args: VirtualNetworkPeeringArgs, opts?: CustomResourceOptions);@overload
def VirtualNetworkPeering(resource_name: str,
args: VirtualNetworkPeeringArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VirtualNetworkPeering(resource_name: str,
opts: Optional[ResourceOptions] = None,
remote_virtual_network_id: Optional[str] = None,
resource_group_name: Optional[str] = None,
virtual_network_name: Optional[str] = None,
allow_forwarded_traffic: Optional[bool] = None,
allow_gateway_transit: Optional[bool] = None,
allow_virtual_network_access: Optional[bool] = None,
name: Optional[str] = None,
use_remote_gateways: Optional[bool] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var virtualNetworkPeeringResource = new Azure.Network.VirtualNetworkPeering("virtualNetworkPeeringResource", new()
{
RemoteVirtualNetworkId = "string",
ResourceGroupName = "string",
VirtualNetworkName = "string",
AllowForwardedTraffic = false,
AllowGatewayTransit = false,
AllowVirtualNetworkAccess = false,
Name = "string",
UseRemoteGateways = false,
});
example, err := network.NewVirtualNetworkPeering(ctx, "virtualNetworkPeeringResource", &network.VirtualNetworkPeeringArgs{
RemoteVirtualNetworkId: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
VirtualNetworkName: pulumi.String("string"),
AllowForwardedTraffic: pulumi.Bool(false),
AllowGatewayTransit: pulumi.Bool(false),
AllowVirtualNetworkAccess: pulumi.Bool(false),
Name: pulumi.String("string"),
UseRemoteGateways: pulumi.Bool(false),
})
var virtualNetworkPeeringResource = new VirtualNetworkPeering("virtualNetworkPeeringResource", VirtualNetworkPeeringArgs.builder()
.remoteVirtualNetworkId("string")
.resourceGroupName("string")
.virtualNetworkName("string")
.allowForwardedTraffic(false)
.allowGatewayTransit(false)
.allowVirtualNetworkAccess(false)
.name("string")
.useRemoteGateways(false)
.build());
virtual_network_peering_resource = azure.network.VirtualNetworkPeering("virtualNetworkPeeringResource",
remote_virtual_network_id="string",
resource_group_name="string",
virtual_network_name="string",
allow_forwarded_traffic=False,
allow_gateway_transit=False,
allow_virtual_network_access=False,
name="string",
use_remote_gateways=False)
const virtualNetworkPeeringResource = new azure.network.VirtualNetworkPeering("virtualNetworkPeeringResource", {
remoteVirtualNetworkId: "string",
resourceGroupName: "string",
virtualNetworkName: "string",
allowForwardedTraffic: false,
allowGatewayTransit: false,
allowVirtualNetworkAccess: false,
name: "string",
useRemoteGateways: false,
});
type: azure:network:VirtualNetworkPeering
properties:
allowForwardedTraffic: false
allowGatewayTransit: false
allowVirtualNetworkAccess: false
name: string
remoteVirtualNetworkId: string
resourceGroupName: string
useRemoteGateways: false
virtualNetworkName: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VirtualNetworkPeering resource accepts the following input properties:
- Remote
Virtual stringNetwork Id - The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
- Resource
Group stringName - 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 stringName - The name of the virtual network. Changing this forces a new resource to be created.
- Allow
Forwarded boolTraffic - Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.
- Allow
Gateway boolTransit - Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.
- Allow
Virtual boolNetwork Access - 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.
- Use
Remote boolGateways - Controls if remote gateways can be used on
the local virtual network. If the flag is set to
true, andallow_gateway_transiton the remote peering is alsotrue, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set totrue. This flag cannot be set if virtual network already has a gateway. Defaults tofalse.
- Remote
Virtual stringNetwork Id - The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
- Resource
Group stringName - 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 stringName - The name of the virtual network. Changing this forces a new resource to be created.
- Allow
Forwarded boolTraffic - Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.
- Allow
Gateway boolTransit - Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.
- Allow
Virtual boolNetwork Access - 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.
- Use
Remote boolGateways - Controls if remote gateways can be used on
the local virtual network. If the flag is set to
true, andallow_gateway_transiton the remote peering is alsotrue, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set totrue. This flag cannot be set if virtual network already has a gateway. Defaults tofalse.
- remote
Virtual StringNetwork Id - The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
- resource
Group StringName - 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 StringName - The name of the virtual network. Changing this forces a new resource to be created.
- allow
Forwarded BooleanTraffic - Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.
- allow
Gateway BooleanTransit - Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.
- allow
Virtual BooleanNetwork Access - 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.
- use
Remote BooleanGateways - Controls if remote gateways can be used on
the local virtual network. If the flag is set to
true, andallow_gateway_transiton the remote peering is alsotrue, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set totrue. This flag cannot be set if virtual network already has a gateway. Defaults tofalse.
- remote
Virtual stringNetwork Id - The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
- resource
Group stringName - 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 stringName - The name of the virtual network. Changing this forces a new resource to be created.
- allow
Forwarded booleanTraffic - Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.
- allow
Gateway booleanTransit - Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.
- allow
Virtual booleanNetwork Access - 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.
- use
Remote booleanGateways - Controls if remote gateways can be used on
the local virtual network. If the flag is set to
true, andallow_gateway_transiton the remote peering is alsotrue, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set totrue. This flag cannot be set if virtual network already has a gateway. Defaults tofalse.
- remote_
virtual_ strnetwork_ id - The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
- resource_
group_ strname - 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_ strname - The name of the virtual network. Changing this forces a new resource to be created.
- allow_
forwarded_ booltraffic - Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.
- allow_
gateway_ booltransit - Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.
- allow_
virtual_ boolnetwork_ access - 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.
- use_
remote_ boolgateways - Controls if remote gateways can be used on
the local virtual network. If the flag is set to
true, andallow_gateway_transiton the remote peering is alsotrue, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set totrue. This flag cannot be set if virtual network already has a gateway. Defaults tofalse.
- remote
Virtual StringNetwork Id - The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
- resource
Group StringName - 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 StringName - The name of the virtual network. Changing this forces a new resource to be created.
- allow
Forwarded BooleanTraffic - Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.
- allow
Gateway BooleanTransit - Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.
- allow
Virtual BooleanNetwork Access - 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.
- use
Remote BooleanGateways - Controls if remote gateways can be used on
the local virtual network. If the flag is set to
true, andallow_gateway_transiton the remote peering is alsotrue, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set totrue. This flag cannot be set if virtual network already has a gateway. Defaults tofalse.
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,
use_remote_gateways: Optional[bool] = None,
virtual_network_name: Optional[str] = None) -> VirtualNetworkPeeringfunc 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)resources: _: type: azure:network:VirtualNetworkPeering get: id: ${id}- 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.
- Allow
Forwarded boolTraffic - Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.
- Allow
Gateway boolTransit - Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.
- Allow
Virtual boolNetwork Access - 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.
- Remote
Virtual stringNetwork Id - The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.
- Use
Remote boolGateways - Controls if remote gateways can be used on
the local virtual network. If the flag is set to
true, andallow_gateway_transiton the remote peering is alsotrue, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set totrue. This flag cannot be set if virtual network already has a gateway. Defaults tofalse. - Virtual
Network stringName - The name of the virtual network. Changing this forces a new resource to be created.
- Allow
Forwarded boolTraffic - Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.
- Allow
Gateway boolTransit - Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.
- Allow
Virtual boolNetwork Access - 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.
- Remote
Virtual stringNetwork Id - The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.
- Use
Remote boolGateways - Controls if remote gateways can be used on
the local virtual network. If the flag is set to
true, andallow_gateway_transiton the remote peering is alsotrue, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set totrue. This flag cannot be set if virtual network already has a gateway. Defaults tofalse. - Virtual
Network stringName - The name of the virtual network. Changing this forces a new resource to be created.
- allow
Forwarded BooleanTraffic - Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.
- allow
Gateway BooleanTransit - Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.
- allow
Virtual BooleanNetwork Access - 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.
- remote
Virtual StringNetwork Id - The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.
- use
Remote BooleanGateways - Controls if remote gateways can be used on
the local virtual network. If the flag is set to
true, andallow_gateway_transiton the remote peering is alsotrue, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set totrue. This flag cannot be set if virtual network already has a gateway. Defaults tofalse. - virtual
Network StringName - The name of the virtual network. Changing this forces a new resource to be created.
- allow
Forwarded booleanTraffic - Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.
- allow
Gateway booleanTransit - Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.
- allow
Virtual booleanNetwork Access - 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.
- remote
Virtual stringNetwork Id - The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
- resource
Group stringName - The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.
- use
Remote booleanGateways - Controls if remote gateways can be used on
the local virtual network. If the flag is set to
true, andallow_gateway_transiton the remote peering is alsotrue, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set totrue. This flag cannot be set if virtual network already has a gateway. Defaults tofalse. - virtual
Network stringName - The name of the virtual network. Changing this forces a new resource to be created.
- allow_
forwarded_ booltraffic - Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.
- allow_
gateway_ booltransit - Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.
- allow_
virtual_ boolnetwork_ access - 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_ strnetwork_ id - The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
- resource_
group_ strname - The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.
- use_
remote_ boolgateways - Controls if remote gateways can be used on
the local virtual network. If the flag is set to
true, andallow_gateway_transiton the remote peering is alsotrue, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set totrue. This flag cannot be set if virtual network already has a gateway. Defaults tofalse. - virtual_
network_ strname - The name of the virtual network. Changing this forces a new resource to be created.
- allow
Forwarded BooleanTraffic - Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to false.
- allow
Gateway BooleanTransit - Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.
- allow
Virtual BooleanNetwork Access - 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.
- remote
Virtual StringNetwork Id - The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.
- use
Remote BooleanGateways - Controls if remote gateways can be used on
the local virtual network. If the flag is set to
true, andallow_gateway_transiton the remote peering is alsotrue, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set totrue. This flag cannot be set if virtual network already has a gateway. Defaults tofalse. - virtual
Network StringName - 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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
