azure-native.network.VirtualNetworkPeering
Explore with Pulumi AI
Peerings in a virtual network resource. Azure REST API version: 2023-02-01. Prior API version in Azure Native 1.x: 2020-11-01.
Other available API versions: 2019-06-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01, 2024-03-01, 2024-05-01.
Example Usage
Create peering
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() => 
{
    var virtualNetworkPeering = new AzureNative.Network.VirtualNetworkPeering("virtualNetworkPeering", new()
    {
        AllowForwardedTraffic = true,
        AllowGatewayTransit = false,
        AllowVirtualNetworkAccess = true,
        RemoteVirtualNetwork = new AzureNative.Network.Inputs.SubResourceArgs
        {
            Id = "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2",
        },
        ResourceGroupName = "peerTest",
        UseRemoteGateways = false,
        VirtualNetworkName = "vnet1",
        VirtualNetworkPeeringName = "peer",
    });
});
package main
import (
	network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := network.NewVirtualNetworkPeering(ctx, "virtualNetworkPeering", &network.VirtualNetworkPeeringArgs{
			AllowForwardedTraffic:     pulumi.Bool(true),
			AllowGatewayTransit:       pulumi.Bool(false),
			AllowVirtualNetworkAccess: pulumi.Bool(true),
			RemoteVirtualNetwork: &network.SubResourceArgs{
				Id: pulumi.String("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"),
			},
			ResourceGroupName:         pulumi.String("peerTest"),
			UseRemoteGateways:         pulumi.Bool(false),
			VirtualNetworkName:        pulumi.String("vnet1"),
			VirtualNetworkPeeringName: pulumi.String("peer"),
		})
		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.azurenative.network.VirtualNetworkPeering;
import com.pulumi.azurenative.network.VirtualNetworkPeeringArgs;
import com.pulumi.azurenative.network.inputs.SubResourceArgs;
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 virtualNetworkPeering = new VirtualNetworkPeering("virtualNetworkPeering", VirtualNetworkPeeringArgs.builder()
            .allowForwardedTraffic(true)
            .allowGatewayTransit(false)
            .allowVirtualNetworkAccess(true)
            .remoteVirtualNetwork(SubResourceArgs.builder()
                .id("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")
                .build())
            .resourceGroupName("peerTest")
            .useRemoteGateways(false)
            .virtualNetworkName("vnet1")
            .virtualNetworkPeeringName("peer")
            .build());
    }
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const virtualNetworkPeering = new azure_native.network.VirtualNetworkPeering("virtualNetworkPeering", {
    allowForwardedTraffic: true,
    allowGatewayTransit: false,
    allowVirtualNetworkAccess: true,
    remoteVirtualNetwork: {
        id: "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2",
    },
    resourceGroupName: "peerTest",
    useRemoteGateways: false,
    virtualNetworkName: "vnet1",
    virtualNetworkPeeringName: "peer",
});
import pulumi
import pulumi_azure_native as azure_native
virtual_network_peering = azure_native.network.VirtualNetworkPeering("virtualNetworkPeering",
    allow_forwarded_traffic=True,
    allow_gateway_transit=False,
    allow_virtual_network_access=True,
    remote_virtual_network={
        "id": "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2",
    },
    resource_group_name="peerTest",
    use_remote_gateways=False,
    virtual_network_name="vnet1",
    virtual_network_peering_name="peer")
resources:
  virtualNetworkPeering:
    type: azure-native:network:VirtualNetworkPeering
    properties:
      allowForwardedTraffic: true
      allowGatewayTransit: false
      allowVirtualNetworkAccess: true
      remoteVirtualNetwork:
        id: /subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2
      resourceGroupName: peerTest
      useRemoteGateways: false
      virtualNetworkName: vnet1
      virtualNetworkPeeringName: peer
Create peering with remote virtual network encryption
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() => 
{
    var virtualNetworkPeering = new AzureNative.Network.VirtualNetworkPeering("virtualNetworkPeering", new()
    {
        AllowForwardedTraffic = true,
        AllowGatewayTransit = false,
        AllowVirtualNetworkAccess = true,
        RemoteVirtualNetwork = new AzureNative.Network.Inputs.SubResourceArgs
        {
            Id = "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2",
        },
        ResourceGroupName = "peerTest",
        UseRemoteGateways = false,
        VirtualNetworkName = "vnet1",
        VirtualNetworkPeeringName = "peer",
    });
});
package main
import (
	network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := network.NewVirtualNetworkPeering(ctx, "virtualNetworkPeering", &network.VirtualNetworkPeeringArgs{
			AllowForwardedTraffic:     pulumi.Bool(true),
			AllowGatewayTransit:       pulumi.Bool(false),
			AllowVirtualNetworkAccess: pulumi.Bool(true),
			RemoteVirtualNetwork: &network.SubResourceArgs{
				Id: pulumi.String("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"),
			},
			ResourceGroupName:         pulumi.String("peerTest"),
			UseRemoteGateways:         pulumi.Bool(false),
			VirtualNetworkName:        pulumi.String("vnet1"),
			VirtualNetworkPeeringName: pulumi.String("peer"),
		})
		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.azurenative.network.VirtualNetworkPeering;
import com.pulumi.azurenative.network.VirtualNetworkPeeringArgs;
import com.pulumi.azurenative.network.inputs.SubResourceArgs;
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 virtualNetworkPeering = new VirtualNetworkPeering("virtualNetworkPeering", VirtualNetworkPeeringArgs.builder()
            .allowForwardedTraffic(true)
            .allowGatewayTransit(false)
            .allowVirtualNetworkAccess(true)
            .remoteVirtualNetwork(SubResourceArgs.builder()
                .id("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")
                .build())
            .resourceGroupName("peerTest")
            .useRemoteGateways(false)
            .virtualNetworkName("vnet1")
            .virtualNetworkPeeringName("peer")
            .build());
    }
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const virtualNetworkPeering = new azure_native.network.VirtualNetworkPeering("virtualNetworkPeering", {
    allowForwardedTraffic: true,
    allowGatewayTransit: false,
    allowVirtualNetworkAccess: true,
    remoteVirtualNetwork: {
        id: "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2",
    },
    resourceGroupName: "peerTest",
    useRemoteGateways: false,
    virtualNetworkName: "vnet1",
    virtualNetworkPeeringName: "peer",
});
import pulumi
import pulumi_azure_native as azure_native
virtual_network_peering = azure_native.network.VirtualNetworkPeering("virtualNetworkPeering",
    allow_forwarded_traffic=True,
    allow_gateway_transit=False,
    allow_virtual_network_access=True,
    remote_virtual_network={
        "id": "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2",
    },
    resource_group_name="peerTest",
    use_remote_gateways=False,
    virtual_network_name="vnet1",
    virtual_network_peering_name="peer")
resources:
  virtualNetworkPeering:
    type: azure-native:network:VirtualNetworkPeering
    properties:
      allowForwardedTraffic: true
      allowGatewayTransit: false
      allowVirtualNetworkAccess: true
      remoteVirtualNetwork:
        id: /subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2
      resourceGroupName: peerTest
      useRemoteGateways: false
      virtualNetworkName: vnet1
      virtualNetworkPeeringName: peer
Sync Peering
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() => 
{
    var virtualNetworkPeering = new AzureNative.Network.VirtualNetworkPeering("virtualNetworkPeering", new()
    {
        AllowForwardedTraffic = true,
        AllowGatewayTransit = false,
        AllowVirtualNetworkAccess = true,
        RemoteVirtualNetwork = new AzureNative.Network.Inputs.SubResourceArgs
        {
            Id = "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2",
        },
        ResourceGroupName = "peerTest",
        SyncRemoteAddressSpace = "true",
        UseRemoteGateways = false,
        VirtualNetworkName = "vnet1",
        VirtualNetworkPeeringName = "peer",
    });
});
package main
import (
	network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := network.NewVirtualNetworkPeering(ctx, "virtualNetworkPeering", &network.VirtualNetworkPeeringArgs{
			AllowForwardedTraffic:     pulumi.Bool(true),
			AllowGatewayTransit:       pulumi.Bool(false),
			AllowVirtualNetworkAccess: pulumi.Bool(true),
			RemoteVirtualNetwork: &network.SubResourceArgs{
				Id: pulumi.String("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"),
			},
			ResourceGroupName:         pulumi.String("peerTest"),
			SyncRemoteAddressSpace:    pulumi.String("true"),
			UseRemoteGateways:         pulumi.Bool(false),
			VirtualNetworkName:        pulumi.String("vnet1"),
			VirtualNetworkPeeringName: pulumi.String("peer"),
		})
		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.azurenative.network.VirtualNetworkPeering;
import com.pulumi.azurenative.network.VirtualNetworkPeeringArgs;
import com.pulumi.azurenative.network.inputs.SubResourceArgs;
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 virtualNetworkPeering = new VirtualNetworkPeering("virtualNetworkPeering", VirtualNetworkPeeringArgs.builder()
            .allowForwardedTraffic(true)
            .allowGatewayTransit(false)
            .allowVirtualNetworkAccess(true)
            .remoteVirtualNetwork(SubResourceArgs.builder()
                .id("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")
                .build())
            .resourceGroupName("peerTest")
            .syncRemoteAddressSpace("true")
            .useRemoteGateways(false)
            .virtualNetworkName("vnet1")
            .virtualNetworkPeeringName("peer")
            .build());
    }
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const virtualNetworkPeering = new azure_native.network.VirtualNetworkPeering("virtualNetworkPeering", {
    allowForwardedTraffic: true,
    allowGatewayTransit: false,
    allowVirtualNetworkAccess: true,
    remoteVirtualNetwork: {
        id: "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2",
    },
    resourceGroupName: "peerTest",
    syncRemoteAddressSpace: "true",
    useRemoteGateways: false,
    virtualNetworkName: "vnet1",
    virtualNetworkPeeringName: "peer",
});
import pulumi
import pulumi_azure_native as azure_native
virtual_network_peering = azure_native.network.VirtualNetworkPeering("virtualNetworkPeering",
    allow_forwarded_traffic=True,
    allow_gateway_transit=False,
    allow_virtual_network_access=True,
    remote_virtual_network={
        "id": "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2",
    },
    resource_group_name="peerTest",
    sync_remote_address_space="true",
    use_remote_gateways=False,
    virtual_network_name="vnet1",
    virtual_network_peering_name="peer")
resources:
  virtualNetworkPeering:
    type: azure-native:network:VirtualNetworkPeering
    properties:
      allowForwardedTraffic: true
      allowGatewayTransit: false
      allowVirtualNetworkAccess: true
      remoteVirtualNetwork:
        id: /subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2
      resourceGroupName: peerTest
      syncRemoteAddressSpace: 'true'
      useRemoteGateways: false
      virtualNetworkName: vnet1
      virtualNetworkPeeringName: peer
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: VirtualNetworkPeeringInitArgs,
                          opts: Optional[ResourceOptions] = None)
@overload
def VirtualNetworkPeering(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          resource_group_name: Optional[str] = None,
                          virtual_network_name: Optional[str] = None,
                          id: Optional[str] = None,
                          remote_bgp_communities: Optional[VirtualNetworkBgpCommunitiesArgs] = None,
                          allow_forwarded_traffic: Optional[bool] = None,
                          name: Optional[str] = None,
                          peering_state: Optional[Union[str, VirtualNetworkPeeringState]] = None,
                          peering_sync_level: Optional[Union[str, VirtualNetworkPeeringLevel]] = None,
                          remote_address_space: Optional[AddressSpaceArgs] = None,
                          do_not_verify_remote_gateways: Optional[bool] = None,
                          remote_virtual_network: Optional[SubResourceArgs] = None,
                          remote_virtual_network_address_space: Optional[AddressSpaceArgs] = None,
                          allow_virtual_network_access: Optional[bool] = None,
                          sync_remote_address_space: Optional[str] = None,
                          type: Optional[str] = None,
                          use_remote_gateways: Optional[bool] = None,
                          allow_gateway_transit: Optional[bool] = None,
                          virtual_network_peering_name: Optional[str] = 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-native: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 VirtualNetworkPeeringInitArgs
- 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 AzureNative.Network.VirtualNetworkPeering("virtualNetworkPeeringResource", new()
{
    ResourceGroupName = "string",
    VirtualNetworkName = "string",
    Id = "string",
    RemoteBgpCommunities = new AzureNative.Network.Inputs.VirtualNetworkBgpCommunitiesArgs
    {
        VirtualNetworkCommunity = "string",
    },
    AllowForwardedTraffic = false,
    Name = "string",
    PeeringState = "string",
    PeeringSyncLevel = "string",
    RemoteAddressSpace = new AzureNative.Network.Inputs.AddressSpaceArgs
    {
        AddressPrefixes = new[]
        {
            "string",
        },
    },
    DoNotVerifyRemoteGateways = false,
    RemoteVirtualNetwork = new AzureNative.Network.Inputs.SubResourceArgs
    {
        Id = "string",
    },
    RemoteVirtualNetworkAddressSpace = new AzureNative.Network.Inputs.AddressSpaceArgs
    {
        AddressPrefixes = new[]
        {
            "string",
        },
    },
    AllowVirtualNetworkAccess = false,
    SyncRemoteAddressSpace = "string",
    Type = "string",
    UseRemoteGateways = false,
    AllowGatewayTransit = false,
    VirtualNetworkPeeringName = "string",
});
example, err := network.NewVirtualNetworkPeering(ctx, "virtualNetworkPeeringResource", &network.VirtualNetworkPeeringArgs{
	ResourceGroupName:  pulumi.String("string"),
	VirtualNetworkName: pulumi.String("string"),
	Id:                 pulumi.String("string"),
	RemoteBgpCommunities: &network.VirtualNetworkBgpCommunitiesArgs{
		VirtualNetworkCommunity: pulumi.String("string"),
	},
	AllowForwardedTraffic: pulumi.Bool(false),
	Name:                  pulumi.String("string"),
	PeeringState:          pulumi.String("string"),
	PeeringSyncLevel:      pulumi.String("string"),
	RemoteAddressSpace: &network.AddressSpaceArgs{
		AddressPrefixes: pulumi.StringArray{
			pulumi.String("string"),
		},
	},
	DoNotVerifyRemoteGateways: pulumi.Bool(false),
	RemoteVirtualNetwork: &network.SubResourceArgs{
		Id: pulumi.String("string"),
	},
	RemoteVirtualNetworkAddressSpace: &network.AddressSpaceArgs{
		AddressPrefixes: pulumi.StringArray{
			pulumi.String("string"),
		},
	},
	AllowVirtualNetworkAccess: pulumi.Bool(false),
	SyncRemoteAddressSpace:    pulumi.String("string"),
	Type:                      pulumi.String("string"),
	UseRemoteGateways:         pulumi.Bool(false),
	AllowGatewayTransit:       pulumi.Bool(false),
	VirtualNetworkPeeringName: pulumi.String("string"),
})
var virtualNetworkPeeringResource = new VirtualNetworkPeering("virtualNetworkPeeringResource", VirtualNetworkPeeringArgs.builder()
    .resourceGroupName("string")
    .virtualNetworkName("string")
    .id("string")
    .remoteBgpCommunities(VirtualNetworkBgpCommunitiesArgs.builder()
        .virtualNetworkCommunity("string")
        .build())
    .allowForwardedTraffic(false)
    .name("string")
    .peeringState("string")
    .peeringSyncLevel("string")
    .remoteAddressSpace(AddressSpaceArgs.builder()
        .addressPrefixes("string")
        .build())
    .doNotVerifyRemoteGateways(false)
    .remoteVirtualNetwork(SubResourceArgs.builder()
        .id("string")
        .build())
    .remoteVirtualNetworkAddressSpace(AddressSpaceArgs.builder()
        .addressPrefixes("string")
        .build())
    .allowVirtualNetworkAccess(false)
    .syncRemoteAddressSpace("string")
    .type("string")
    .useRemoteGateways(false)
    .allowGatewayTransit(false)
    .virtualNetworkPeeringName("string")
    .build());
virtual_network_peering_resource = azure_native.network.VirtualNetworkPeering("virtualNetworkPeeringResource",
    resource_group_name="string",
    virtual_network_name="string",
    id="string",
    remote_bgp_communities={
        "virtual_network_community": "string",
    },
    allow_forwarded_traffic=False,
    name="string",
    peering_state="string",
    peering_sync_level="string",
    remote_address_space={
        "address_prefixes": ["string"],
    },
    do_not_verify_remote_gateways=False,
    remote_virtual_network={
        "id": "string",
    },
    remote_virtual_network_address_space={
        "address_prefixes": ["string"],
    },
    allow_virtual_network_access=False,
    sync_remote_address_space="string",
    type="string",
    use_remote_gateways=False,
    allow_gateway_transit=False,
    virtual_network_peering_name="string")
const virtualNetworkPeeringResource = new azure_native.network.VirtualNetworkPeering("virtualNetworkPeeringResource", {
    resourceGroupName: "string",
    virtualNetworkName: "string",
    id: "string",
    remoteBgpCommunities: {
        virtualNetworkCommunity: "string",
    },
    allowForwardedTraffic: false,
    name: "string",
    peeringState: "string",
    peeringSyncLevel: "string",
    remoteAddressSpace: {
        addressPrefixes: ["string"],
    },
    doNotVerifyRemoteGateways: false,
    remoteVirtualNetwork: {
        id: "string",
    },
    remoteVirtualNetworkAddressSpace: {
        addressPrefixes: ["string"],
    },
    allowVirtualNetworkAccess: false,
    syncRemoteAddressSpace: "string",
    type: "string",
    useRemoteGateways: false,
    allowGatewayTransit: false,
    virtualNetworkPeeringName: "string",
});
type: azure-native:network:VirtualNetworkPeering
properties:
    allowForwardedTraffic: false
    allowGatewayTransit: false
    allowVirtualNetworkAccess: false
    doNotVerifyRemoteGateways: false
    id: string
    name: string
    peeringState: string
    peeringSyncLevel: string
    remoteAddressSpace:
        addressPrefixes:
            - string
    remoteBgpCommunities:
        virtualNetworkCommunity: string
    remoteVirtualNetwork:
        id: string
    remoteVirtualNetworkAddressSpace:
        addressPrefixes:
            - string
    resourceGroupName: string
    syncRemoteAddressSpace: string
    type: string
    useRemoteGateways: false
    virtualNetworkName: string
    virtualNetworkPeeringName: 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:
- ResourceGroup stringName 
- The name of the resource group.
- VirtualNetwork stringName 
- The name of the virtual network.
- AllowForwarded boolTraffic 
- Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network.
- AllowGateway boolTransit 
- If gateway links can be used in remote virtual networking to link to this virtual network.
- AllowVirtual boolNetwork Access 
- Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space.
- DoNot boolVerify Remote Gateways 
- If we need to verify the provisioning state of the remote gateway.
- Id string
- Resource ID.
- Name string
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- PeeringState string | Pulumi.Azure Native. Network. Virtual Network Peering State 
- The status of the virtual network peering.
- PeeringSync string | Pulumi.Level Azure Native. Network. Virtual Network Peering Level 
- The peering sync status of the virtual network peering.
- RemoteAddress Pulumi.Space Azure Native. Network. Inputs. Address Space 
- The reference to the address space peered with the remote virtual network.
- RemoteBgp Pulumi.Communities Azure Native. Network. Inputs. Virtual Network Bgp Communities 
- The reference to the remote virtual network's Bgp Communities.
- RemoteVirtual Pulumi.Network Azure Native. Network. Inputs. Sub Resource 
- The reference to the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering).
- RemoteVirtual Pulumi.Network Address Space Azure Native. Network. Inputs. Address Space 
- The reference to the current address space of the remote virtual network.
- SyncRemote stringAddress Space 
- Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated.
- Type string
- Resource type.
- UseRemote boolGateways 
- If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on 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.
- VirtualNetwork stringPeering Name 
- The name of the peering.
- ResourceGroup stringName 
- The name of the resource group.
- VirtualNetwork stringName 
- The name of the virtual network.
- AllowForwarded boolTraffic 
- Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network.
- AllowGateway boolTransit 
- If gateway links can be used in remote virtual networking to link to this virtual network.
- AllowVirtual boolNetwork Access 
- Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space.
- DoNot boolVerify Remote Gateways 
- If we need to verify the provisioning state of the remote gateway.
- Id string
- Resource ID.
- Name string
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- PeeringState string | VirtualNetwork Peering State Enum 
- The status of the virtual network peering.
- PeeringSync string | VirtualLevel Network Peering Level 
- The peering sync status of the virtual network peering.
- RemoteAddress AddressSpace Space Args 
- The reference to the address space peered with the remote virtual network.
- RemoteBgp VirtualCommunities Network Bgp Communities Args 
- The reference to the remote virtual network's Bgp Communities.
- RemoteVirtual SubNetwork Resource Args 
- The reference to the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering).
- RemoteVirtual AddressNetwork Address Space Space Args 
- The reference to the current address space of the remote virtual network.
- SyncRemote stringAddress Space 
- Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated.
- Type string
- Resource type.
- UseRemote boolGateways 
- If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on 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.
- VirtualNetwork stringPeering Name 
- The name of the peering.
- resourceGroup StringName 
- The name of the resource group.
- virtualNetwork StringName 
- The name of the virtual network.
- allowForwarded BooleanTraffic 
- Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network.
- allowGateway BooleanTransit 
- If gateway links can be used in remote virtual networking to link to this virtual network.
- allowVirtual BooleanNetwork Access 
- Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space.
- doNot BooleanVerify Remote Gateways 
- If we need to verify the provisioning state of the remote gateway.
- id String
- Resource ID.
- name String
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- peeringState String | VirtualNetwork Peering State 
- The status of the virtual network peering.
- peeringSync String | VirtualLevel Network Peering Level 
- The peering sync status of the virtual network peering.
- remoteAddress AddressSpace Space 
- The reference to the address space peered with the remote virtual network.
- remoteBgp VirtualCommunities Network Bgp Communities 
- The reference to the remote virtual network's Bgp Communities.
- remoteVirtual SubNetwork Resource 
- The reference to the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering).
- remoteVirtual AddressNetwork Address Space Space 
- The reference to the current address space of the remote virtual network.
- syncRemote StringAddress Space 
- Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated.
- type String
- Resource type.
- useRemote BooleanGateways 
- If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on 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.
- virtualNetwork StringPeering Name 
- The name of the peering.
- resourceGroup stringName 
- The name of the resource group.
- virtualNetwork stringName 
- The name of the virtual network.
- allowForwarded booleanTraffic 
- Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network.
- allowGateway booleanTransit 
- If gateway links can be used in remote virtual networking to link to this virtual network.
- allowVirtual booleanNetwork Access 
- Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space.
- doNot booleanVerify Remote Gateways 
- If we need to verify the provisioning state of the remote gateway.
- id string
- Resource ID.
- name string
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- peeringState string | VirtualNetwork Peering State 
- The status of the virtual network peering.
- peeringSync string | VirtualLevel Network Peering Level 
- The peering sync status of the virtual network peering.
- remoteAddress AddressSpace Space 
- The reference to the address space peered with the remote virtual network.
- remoteBgp VirtualCommunities Network Bgp Communities 
- The reference to the remote virtual network's Bgp Communities.
- remoteVirtual SubNetwork Resource 
- The reference to the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering).
- remoteVirtual AddressNetwork Address Space Space 
- The reference to the current address space of the remote virtual network.
- syncRemote stringAddress Space 
- Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated.
- type string
- Resource type.
- useRemote booleanGateways 
- If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on 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.
- virtualNetwork stringPeering Name 
- The name of the peering.
- resource_group_ strname 
- The name of the resource group.
- virtual_network_ strname 
- The name of the virtual network.
- allow_forwarded_ booltraffic 
- Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network.
- allow_gateway_ booltransit 
- If gateway links can be used in remote virtual networking to link to this virtual network.
- allow_virtual_ boolnetwork_ access 
- Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space.
- do_not_ boolverify_ remote_ gateways 
- If we need to verify the provisioning state of the remote gateway.
- id str
- Resource ID.
- name str
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- peering_state str | VirtualNetwork Peering State 
- The status of the virtual network peering.
- peering_sync_ str | Virtuallevel Network Peering Level 
- The peering sync status of the virtual network peering.
- remote_address_ Addressspace Space Args 
- The reference to the address space peered with the remote virtual network.
- remote_bgp_ Virtualcommunities Network Bgp Communities Args 
- The reference to the remote virtual network's Bgp Communities.
- remote_virtual_ Subnetwork Resource Args 
- The reference to the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering).
- remote_virtual_ Addressnetwork_ address_ space Space Args 
- The reference to the current address space of the remote virtual network.
- sync_remote_ straddress_ space 
- Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated.
- type str
- Resource type.
- use_remote_ boolgateways 
- If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on 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.
- virtual_network_ strpeering_ name 
- The name of the peering.
- resourceGroup StringName 
- The name of the resource group.
- virtualNetwork StringName 
- The name of the virtual network.
- allowForwarded BooleanTraffic 
- Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network.
- allowGateway BooleanTransit 
- If gateway links can be used in remote virtual networking to link to this virtual network.
- allowVirtual BooleanNetwork Access 
- Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space.
- doNot BooleanVerify Remote Gateways 
- If we need to verify the provisioning state of the remote gateway.
- id String
- Resource ID.
- name String
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- peeringState String | "Initiated" | "Connected" | "Disconnected"
- The status of the virtual network peering.
- peeringSync String | "FullyLevel In Sync" | "Remote Not In Sync" | "Local Not In Sync" | "Local And Remote Not In Sync" 
- The peering sync status of the virtual network peering.
- remoteAddress Property MapSpace 
- The reference to the address space peered with the remote virtual network.
- remoteBgp Property MapCommunities 
- The reference to the remote virtual network's Bgp Communities.
- remoteVirtual Property MapNetwork 
- The reference to the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering).
- remoteVirtual Property MapNetwork Address Space 
- The reference to the current address space of the remote virtual network.
- syncRemote StringAddress Space 
- Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated.
- type String
- Resource type.
- useRemote BooleanGateways 
- If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on 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.
- virtualNetwork StringPeering Name 
- The name of the peering.
Outputs
All input properties are implicitly available as output properties. Additionally, the VirtualNetworkPeering resource produces the following output properties:
- Etag string
- A unique read-only string that changes whenever the resource is updated.
- Id string
- The provider-assigned unique ID for this managed resource.
- ProvisioningState string
- The provisioning state of the virtual network peering resource.
- RemoteVirtual Pulumi.Network Encryption Azure Native. Network. Outputs. Virtual Network Encryption Response 
- The reference to the remote virtual network's encryption
- ResourceGuid string
- The resourceGuid property of the Virtual Network peering resource.
- Etag string
- A unique read-only string that changes whenever the resource is updated.
- Id string
- The provider-assigned unique ID for this managed resource.
- ProvisioningState string
- The provisioning state of the virtual network peering resource.
- RemoteVirtual VirtualNetwork Encryption Network Encryption Response 
- The reference to the remote virtual network's encryption
- ResourceGuid string
- The resourceGuid property of the Virtual Network peering resource.
- etag String
- A unique read-only string that changes whenever the resource is updated.
- id String
- The provider-assigned unique ID for this managed resource.
- provisioningState String
- The provisioning state of the virtual network peering resource.
- remoteVirtual VirtualNetwork Encryption Network Encryption Response 
- The reference to the remote virtual network's encryption
- resourceGuid String
- The resourceGuid property of the Virtual Network peering resource.
- etag string
- A unique read-only string that changes whenever the resource is updated.
- id string
- The provider-assigned unique ID for this managed resource.
- provisioningState string
- The provisioning state of the virtual network peering resource.
- remoteVirtual VirtualNetwork Encryption Network Encryption Response 
- The reference to the remote virtual network's encryption
- resourceGuid string
- The resourceGuid property of the Virtual Network peering resource.
- etag str
- A unique read-only string that changes whenever the resource is updated.
- id str
- The provider-assigned unique ID for this managed resource.
- provisioning_state str
- The provisioning state of the virtual network peering resource.
- remote_virtual_ Virtualnetwork_ encryption Network Encryption Response 
- The reference to the remote virtual network's encryption
- resource_guid str
- The resourceGuid property of the Virtual Network peering resource.
- etag String
- A unique read-only string that changes whenever the resource is updated.
- id String
- The provider-assigned unique ID for this managed resource.
- provisioningState String
- The provisioning state of the virtual network peering resource.
- remoteVirtual Property MapNetwork Encryption 
- The reference to the remote virtual network's encryption
- resourceGuid String
- The resourceGuid property of the Virtual Network peering resource.
Supporting Types
AddressSpace, AddressSpaceArgs    
- AddressPrefixes List<string>
- A list of address blocks reserved for this virtual network in CIDR notation.
- AddressPrefixes []string
- A list of address blocks reserved for this virtual network in CIDR notation.
- addressPrefixes List<String>
- A list of address blocks reserved for this virtual network in CIDR notation.
- addressPrefixes string[]
- A list of address blocks reserved for this virtual network in CIDR notation.
- address_prefixes Sequence[str]
- A list of address blocks reserved for this virtual network in CIDR notation.
- addressPrefixes List<String>
- A list of address blocks reserved for this virtual network in CIDR notation.
AddressSpaceResponse, AddressSpaceResponseArgs      
- AddressPrefixes List<string>
- A list of address blocks reserved for this virtual network in CIDR notation.
- AddressPrefixes []string
- A list of address blocks reserved for this virtual network in CIDR notation.
- addressPrefixes List<String>
- A list of address blocks reserved for this virtual network in CIDR notation.
- addressPrefixes string[]
- A list of address blocks reserved for this virtual network in CIDR notation.
- address_prefixes Sequence[str]
- A list of address blocks reserved for this virtual network in CIDR notation.
- addressPrefixes List<String>
- A list of address blocks reserved for this virtual network in CIDR notation.
SubResource, SubResourceArgs    
- Id string
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- Id string
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- id String
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- id string
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- id str
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- id String
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
SubResourceResponse, SubResourceResponseArgs      
- Id string
- Resource ID.
- Id string
- Resource ID.
- id String
- Resource ID.
- id string
- Resource ID.
- id str
- Resource ID.
- id String
- Resource ID.
VirtualNetworkBgpCommunities, VirtualNetworkBgpCommunitiesArgs        
- VirtualNetwork stringCommunity 
- The BGP community associated with the virtual network.
- VirtualNetwork stringCommunity 
- The BGP community associated with the virtual network.
- virtualNetwork StringCommunity 
- The BGP community associated with the virtual network.
- virtualNetwork stringCommunity 
- The BGP community associated with the virtual network.
- virtual_network_ strcommunity 
- The BGP community associated with the virtual network.
- virtualNetwork StringCommunity 
- The BGP community associated with the virtual network.
VirtualNetworkBgpCommunitiesResponse, VirtualNetworkBgpCommunitiesResponseArgs          
- RegionalCommunity string
- The BGP community associated with the region of the virtual network.
- VirtualNetwork stringCommunity 
- The BGP community associated with the virtual network.
- RegionalCommunity string
- The BGP community associated with the region of the virtual network.
- VirtualNetwork stringCommunity 
- The BGP community associated with the virtual network.
- regionalCommunity String
- The BGP community associated with the region of the virtual network.
- virtualNetwork StringCommunity 
- The BGP community associated with the virtual network.
- regionalCommunity string
- The BGP community associated with the region of the virtual network.
- virtualNetwork stringCommunity 
- The BGP community associated with the virtual network.
- regional_community str
- The BGP community associated with the region of the virtual network.
- virtual_network_ strcommunity 
- The BGP community associated with the virtual network.
- regionalCommunity String
- The BGP community associated with the region of the virtual network.
- virtualNetwork StringCommunity 
- The BGP community associated with the virtual network.
VirtualNetworkEncryptionResponse, VirtualNetworkEncryptionResponseArgs        
- Enabled bool
- Indicates if encryption is enabled on the virtual network.
- Enforcement string
- If the encrypted VNet allows VM that does not support encryption
- Enabled bool
- Indicates if encryption is enabled on the virtual network.
- Enforcement string
- If the encrypted VNet allows VM that does not support encryption
- enabled Boolean
- Indicates if encryption is enabled on the virtual network.
- enforcement String
- If the encrypted VNet allows VM that does not support encryption
- enabled boolean
- Indicates if encryption is enabled on the virtual network.
- enforcement string
- If the encrypted VNet allows VM that does not support encryption
- enabled bool
- Indicates if encryption is enabled on the virtual network.
- enforcement str
- If the encrypted VNet allows VM that does not support encryption
- enabled Boolean
- Indicates if encryption is enabled on the virtual network.
- enforcement String
- If the encrypted VNet allows VM that does not support encryption
VirtualNetworkPeeringLevel, VirtualNetworkPeeringLevelArgs        
- FullyIn Sync 
- FullyInSync
- RemoteNot In Sync 
- RemoteNotInSync
- LocalNot In Sync 
- LocalNotInSync
- LocalAnd Remote Not In Sync 
- LocalAndRemoteNotInSync
- VirtualNetwork Peering Level Fully In Sync 
- FullyInSync
- VirtualNetwork Peering Level Remote Not In Sync 
- RemoteNotInSync
- VirtualNetwork Peering Level Local Not In Sync 
- LocalNotInSync
- VirtualNetwork Peering Level Local And Remote Not In Sync 
- LocalAndRemoteNotInSync
- FullyIn Sync 
- FullyInSync
- RemoteNot In Sync 
- RemoteNotInSync
- LocalNot In Sync 
- LocalNotInSync
- LocalAnd Remote Not In Sync 
- LocalAndRemoteNotInSync
- FullyIn Sync 
- FullyInSync
- RemoteNot In Sync 
- RemoteNotInSync
- LocalNot In Sync 
- LocalNotInSync
- LocalAnd Remote Not In Sync 
- LocalAndRemoteNotInSync
- FULLY_IN_SYNC
- FullyInSync
- REMOTE_NOT_IN_SYNC
- RemoteNotInSync
- LOCAL_NOT_IN_SYNC
- LocalNotInSync
- LOCAL_AND_REMOTE_NOT_IN_SYNC
- LocalAndRemoteNotInSync
- "FullyIn Sync" 
- FullyInSync
- "RemoteNot In Sync" 
- RemoteNotInSync
- "LocalNot In Sync" 
- LocalNotInSync
- "LocalAnd Remote Not In Sync" 
- LocalAndRemoteNotInSync
VirtualNetworkPeeringState, VirtualNetworkPeeringStateArgs        
- Initiated
- Initiated
- Connected
- Connected
- Disconnected
- Disconnected
- VirtualNetwork Peering State Initiated 
- Initiated
- VirtualNetwork Peering State Connected 
- Connected
- VirtualNetwork Peering State Disconnected 
- Disconnected
- Initiated
- Initiated
- Connected
- Connected
- Disconnected
- Disconnected
- Initiated
- Initiated
- Connected
- Connected
- Disconnected
- Disconnected
- INITIATED
- Initiated
- CONNECTED
- Connected
- DISCONNECTED
- Disconnected
- "Initiated"
- Initiated
- "Connected"
- Connected
- "Disconnected"
- Disconnected
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:network:VirtualNetworkPeering peer /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName} 
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0