All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.network.kotlin.VirtualNetworkPeeringArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.network.kotlin

import com.pulumi.azure.network.VirtualNetworkPeeringArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a virtual network peering which allows resources to access other
 * resources in the linked virtual network.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "peeredvnets-rg",
 *     location: "West Europe",
 * });
 * const example_1 = new azure.network.VirtualNetwork("example-1", {
 *     name: "peternetwork1",
 *     resourceGroupName: example.name,
 *     addressSpaces: ["10.0.1.0/24"],
 *     location: example.location,
 * });
 * const example_2 = new azure.network.VirtualNetwork("example-2", {
 *     name: "peternetwork2",
 *     resourceGroupName: example.name,
 *     addressSpaces: ["10.0.2.0/24"],
 *     location: example.location,
 * });
 * const example_1VirtualNetworkPeering = new azure.network.VirtualNetworkPeering("example-1", {
 *     name: "peer1to2",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: example_1.name,
 *     remoteVirtualNetworkId: example_2.id,
 * });
 * const example_2VirtualNetworkPeering = new azure.network.VirtualNetworkPeering("example-2", {
 *     name: "peer2to1",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: example_2.name,
 *     remoteVirtualNetworkId: example_1.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="peeredvnets-rg",
 *     location="West Europe")
 * example_1 = azure.network.VirtualNetwork("example-1",
 *     name="peternetwork1",
 *     resource_group_name=example.name,
 *     address_spaces=["10.0.1.0/24"],
 *     location=example.location)
 * example_2 = azure.network.VirtualNetwork("example-2",
 *     name="peternetwork2",
 *     resource_group_name=example.name,
 *     address_spaces=["10.0.2.0/24"],
 *     location=example.location)
 * example_1_virtual_network_peering = azure.network.VirtualNetworkPeering("example-1",
 *     name="peer1to2",
 *     resource_group_name=example.name,
 *     virtual_network_name=example_1.name,
 *     remote_virtual_network_id=example_2.id)
 * example_2_virtual_network_peering = azure.network.VirtualNetworkPeering("example-2",
 *     name="peer2to1",
 *     resource_group_name=example.name,
 *     virtual_network_name=example_2.name,
 *     remote_virtual_network_id=example_1.id)
 * ```
 * ```csharp
 * 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()
 *     {
 *         Name = "peeredvnets-rg",
 *         Location = "West Europe",
 *     });
 *     var example_1 = new Azure.Network.VirtualNetwork("example-1", new()
 *     {
 *         Name = "peternetwork1",
 *         ResourceGroupName = example.Name,
 *         AddressSpaces = new[]
 *         {
 *             "10.0.1.0/24",
 *         },
 *         Location = example.Location,
 *     });
 *     var example_2 = new Azure.Network.VirtualNetwork("example-2", new()
 *     {
 *         Name = "peternetwork2",
 *         ResourceGroupName = example.Name,
 *         AddressSpaces = new[]
 *         {
 *             "10.0.2.0/24",
 *         },
 *         Location = example.Location,
 *     });
 *     var example_1VirtualNetworkPeering = new Azure.Network.VirtualNetworkPeering("example-1", new()
 *     {
 *         Name = "peer1to2",
 *         ResourceGroupName = example.Name,
 *         VirtualNetworkName = example_1.Name,
 *         RemoteVirtualNetworkId = example_2.Id,
 *     });
 *     var example_2VirtualNetworkPeering = new Azure.Network.VirtualNetworkPeering("example-2", new()
 *     {
 *         Name = "peer2to1",
 *         ResourceGroupName = example.Name,
 *         VirtualNetworkName = example_2.Name,
 *         RemoteVirtualNetworkId = example_1.Id,
 *     });
 * });
 * ```
 * ```go
 * 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{
 * 			Name:     pulumi.String("peeredvnets-rg"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewVirtualNetwork(ctx, "example-1", &network.VirtualNetworkArgs{
 * 			Name:              pulumi.String("peternetwork1"),
 * 			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-2", &network.VirtualNetworkArgs{
 * 			Name:              pulumi.String("peternetwork2"),
 * 			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-1", &network.VirtualNetworkPeeringArgs{
 * 			Name:                   pulumi.String("peer1to2"),
 * 			ResourceGroupName:      example.Name,
 * 			VirtualNetworkName:     example_1.Name,
 * 			RemoteVirtualNetworkId: example_2.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewVirtualNetworkPeering(ctx, "example-2", &network.VirtualNetworkPeeringArgs{
 * 			Name:                   pulumi.String("peer2to1"),
 * 			ResourceGroupName:      example.Name,
 * 			VirtualNetworkName:     example_2.Name,
 * 			RemoteVirtualNetworkId: example_1.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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()
 *             .name("peeredvnets-rg")
 *             .location("West Europe")
 *             .build());
 *         var example_1 = new VirtualNetwork("example-1", VirtualNetworkArgs.builder()
 *             .name("peternetwork1")
 *             .resourceGroupName(example.name())
 *             .addressSpaces("10.0.1.0/24")
 *             .location(example.location())
 *             .build());
 *         var example_2 = new VirtualNetwork("example-2", VirtualNetworkArgs.builder()
 *             .name("peternetwork2")
 *             .resourceGroupName(example.name())
 *             .addressSpaces("10.0.2.0/24")
 *             .location(example.location())
 *             .build());
 *         var example_1VirtualNetworkPeering = new VirtualNetworkPeering("example-1VirtualNetworkPeering", VirtualNetworkPeeringArgs.builder()
 *             .name("peer1to2")
 *             .resourceGroupName(example.name())
 *             .virtualNetworkName(example_1.name())
 *             .remoteVirtualNetworkId(example_2.id())
 *             .build());
 *         var example_2VirtualNetworkPeering = new VirtualNetworkPeering("example-2VirtualNetworkPeering", VirtualNetworkPeeringArgs.builder()
 *             .name("peer2to1")
 *             .resourceGroupName(example.name())
 *             .virtualNetworkName(example_2.name())
 *             .remoteVirtualNetworkId(example_1.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: peeredvnets-rg
 *       location: West Europe
 *   example-1:
 *     type: azure:network:VirtualNetwork
 *     properties:
 *       name: peternetwork1
 *       resourceGroupName: ${example.name}
 *       addressSpaces:
 *         - 10.0.1.0/24
 *       location: ${example.location}
 *   example-2:
 *     type: azure:network:VirtualNetwork
 *     properties:
 *       name: peternetwork2
 *       resourceGroupName: ${example.name}
 *       addressSpaces:
 *         - 10.0.2.0/24
 *       location: ${example.location}
 *   example-1VirtualNetworkPeering:
 *     type: azure:network:VirtualNetworkPeering
 *     name: example-1
 *     properties:
 *       name: peer1to2
 *       resourceGroupName: ${example.name}
 *       virtualNetworkName: ${["example-1"].name}
 *       remoteVirtualNetworkId: ${["example-2"].id}
 *   example-2VirtualNetworkPeering:
 *     type: azure:network:VirtualNetworkPeering
 *     name: example-2
 *     properties:
 *       name: peer2to1
 *       resourceGroupName: ${example.name}
 *       virtualNetworkName: ${["example-2"].name}
 *       remoteVirtualNetworkId: ${["example-1"].id}
 * ```
 * 
 * ### Triggers)
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as std from "@pulumi/std";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "peeredvnets-rg",
 *     location: "West Europe",
 * });
 * const example_1 = new azure.network.VirtualNetwork("example-1", {
 *     name: "peternetwork1",
 *     resourceGroupName: example.name,
 *     addressSpaces: ["10.0.1.0/24"],
 *     location: example.location,
 * });
 * const example_2 = new azure.network.VirtualNetwork("example-2", {
 *     name: "peternetwork2",
 *     resourceGroupName: example.name,
 *     addressSpaces: ["10.0.2.0/24"],
 *     location: example.location,
 * });
 * const example_1VirtualNetworkPeering = new azure.network.VirtualNetworkPeering("example-1", {
 *     name: "peer1to2",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: example_1.name,
 *     remoteVirtualNetworkId: example_2.id,
 *     triggers: {
 *         remote_address_space: std.joinOutput({
 *             separator: ",",
 *             input: example_2.addressSpaces,
 *         }).apply(invoke => invoke.result),
 *     },
 * });
 * const example_2VirtualNetworkPeering = new azure.network.VirtualNetworkPeering("example-2", {
 *     name: "peer2to1",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: example_2.name,
 *     remoteVirtualNetworkId: example_1.id,
 *     triggers: {
 *         remote_address_space: std.joinOutput({
 *             separator: ",",
 *             input: example_1.addressSpaces,
 *         }).apply(invoke => invoke.result),
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * import pulumi_std as std
 * example = azure.core.ResourceGroup("example",
 *     name="peeredvnets-rg",
 *     location="West Europe")
 * example_1 = azure.network.VirtualNetwork("example-1",
 *     name="peternetwork1",
 *     resource_group_name=example.name,
 *     address_spaces=["10.0.1.0/24"],
 *     location=example.location)
 * example_2 = azure.network.VirtualNetwork("example-2",
 *     name="peternetwork2",
 *     resource_group_name=example.name,
 *     address_spaces=["10.0.2.0/24"],
 *     location=example.location)
 * example_1_virtual_network_peering = azure.network.VirtualNetworkPeering("example-1",
 *     name="peer1to2",
 *     resource_group_name=example.name,
 *     virtual_network_name=example_1.name,
 *     remote_virtual_network_id=example_2.id,
 *     triggers={
 *         "remote_address_space": std.join_output(separator=",",
 *             input=example_2.address_spaces).apply(lambda invoke: invoke.result),
 *     })
 * example_2_virtual_network_peering = azure.network.VirtualNetworkPeering("example-2",
 *     name="peer2to1",
 *     resource_group_name=example.name,
 *     virtual_network_name=example_2.name,
 *     remote_virtual_network_id=example_1.id,
 *     triggers={
 *         "remote_address_space": std.join_output(separator=",",
 *             input=example_1.address_spaces).apply(lambda invoke: invoke.result),
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "peeredvnets-rg",
 *         Location = "West Europe",
 *     });
 *     var example_1 = new Azure.Network.VirtualNetwork("example-1", new()
 *     {
 *         Name = "peternetwork1",
 *         ResourceGroupName = example.Name,
 *         AddressSpaces = new[]
 *         {
 *             "10.0.1.0/24",
 *         },
 *         Location = example.Location,
 *     });
 *     var example_2 = new Azure.Network.VirtualNetwork("example-2", new()
 *     {
 *         Name = "peternetwork2",
 *         ResourceGroupName = example.Name,
 *         AddressSpaces = new[]
 *         {
 *             "10.0.2.0/24",
 *         },
 *         Location = example.Location,
 *     });
 *     var example_1VirtualNetworkPeering = new Azure.Network.VirtualNetworkPeering("example-1", new()
 *     {
 *         Name = "peer1to2",
 *         ResourceGroupName = example.Name,
 *         VirtualNetworkName = example_1.Name,
 *         RemoteVirtualNetworkId = example_2.Id,
 *         Triggers =
 *         {
 *             { "remote_address_space", Std.Join.Invoke(new()
 *             {
 *                 Separator = ",",
 *                 Input = example_2.AddressSpaces,
 *             }).Apply(invoke => invoke.Result) },
 *         },
 *     });
 *     var example_2VirtualNetworkPeering = new Azure.Network.VirtualNetworkPeering("example-2", new()
 *     {
 *         Name = "peer2to1",
 *         ResourceGroupName = example.Name,
 *         VirtualNetworkName = example_2.Name,
 *         RemoteVirtualNetworkId = example_1.Id,
 *         Triggers =
 *         {
 *             { "remote_address_space", Std.Join.Invoke(new()
 *             {
 *                 Separator = ",",
 *                 Input = example_1.AddressSpaces,
 *             }).Apply(invoke => invoke.Result) },
 *         },
 *     });
 * });
 * ```
 * ```go
 * 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-std/sdk/go/std"
 * 	"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{
 * 			Name:     pulumi.String("peeredvnets-rg"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewVirtualNetwork(ctx, "example-1", &network.VirtualNetworkArgs{
 * 			Name:              pulumi.String("peternetwork1"),
 * 			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-2", &network.VirtualNetworkArgs{
 * 			Name:              pulumi.String("peternetwork2"),
 * 			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-1", &network.VirtualNetworkPeeringArgs{
 * 			Name:                   pulumi.String("peer1to2"),
 * 			ResourceGroupName:      example.Name,
 * 			VirtualNetworkName:     example_1.Name,
 * 			RemoteVirtualNetworkId: example_2.ID(),
 * 			Triggers: pulumi.StringMap{
 * 				"remote_address_space": std.JoinOutput(ctx, std.JoinOutputArgs{
 * 					Separator: pulumi.String(","),
 * 					Input:     example_2.AddressSpaces,
 * 				}, nil).ApplyT(func(invoke std.JoinResult) (*string, error) {
 * 					return invoke.Result, nil
 * 				}).(pulumi.StringPtrOutput),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewVirtualNetworkPeering(ctx, "example-2", &network.VirtualNetworkPeeringArgs{
 * 			Name:                   pulumi.String("peer2to1"),
 * 			ResourceGroupName:      example.Name,
 * 			VirtualNetworkName:     example_2.Name,
 * 			RemoteVirtualNetworkId: example_1.ID(),
 * 			Triggers: pulumi.StringMap{
 * 				"remote_address_space": std.JoinOutput(ctx, std.JoinOutputArgs{
 * 					Separator: pulumi.String(","),
 * 					Input:     example_1.AddressSpaces,
 * 				}, nil).ApplyT(func(invoke std.JoinResult) (*string, error) {
 * 					return invoke.Result, nil
 * 				}).(pulumi.StringPtrOutput),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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()
 *             .name("peeredvnets-rg")
 *             .location("West Europe")
 *             .build());
 *         var example_1 = new VirtualNetwork("example-1", VirtualNetworkArgs.builder()
 *             .name("peternetwork1")
 *             .resourceGroupName(example.name())
 *             .addressSpaces("10.0.1.0/24")
 *             .location(example.location())
 *             .build());
 *         var example_2 = new VirtualNetwork("example-2", VirtualNetworkArgs.builder()
 *             .name("peternetwork2")
 *             .resourceGroupName(example.name())
 *             .addressSpaces("10.0.2.0/24")
 *             .location(example.location())
 *             .build());
 *         var example_1VirtualNetworkPeering = new VirtualNetworkPeering("example-1VirtualNetworkPeering", VirtualNetworkPeeringArgs.builder()
 *             .name("peer1to2")
 *             .resourceGroupName(example.name())
 *             .virtualNetworkName(example_1.name())
 *             .remoteVirtualNetworkId(example_2.id())
 *             .triggers(Map.of("remote_address_space", StdFunctions.join().applyValue(invoke -> invoke.result())))
 *             .build());
 *         var example_2VirtualNetworkPeering = new VirtualNetworkPeering("example-2VirtualNetworkPeering", VirtualNetworkPeeringArgs.builder()
 *             .name("peer2to1")
 *             .resourceGroupName(example.name())
 *             .virtualNetworkName(example_2.name())
 *             .remoteVirtualNetworkId(example_1.id())
 *             .triggers(Map.of("remote_address_space", StdFunctions.join().applyValue(invoke -> invoke.result())))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: peeredvnets-rg
 *       location: West Europe
 *   example-1:
 *     type: azure:network:VirtualNetwork
 *     properties:
 *       name: peternetwork1
 *       resourceGroupName: ${example.name}
 *       addressSpaces:
 *         - 10.0.1.0/24
 *       location: ${example.location}
 *   example-2:
 *     type: azure:network:VirtualNetwork
 *     properties:
 *       name: peternetwork2
 *       resourceGroupName: ${example.name}
 *       addressSpaces:
 *         - 10.0.2.0/24
 *       location: ${example.location}
 *   example-1VirtualNetworkPeering:
 *     type: azure:network:VirtualNetworkPeering
 *     name: example-1
 *     properties:
 *       name: peer1to2
 *       resourceGroupName: ${example.name}
 *       virtualNetworkName: ${["example-1"].name}
 *       remoteVirtualNetworkId: ${["example-2"].id}
 *       triggers:
 *         remote_address_space:
 *           fn::invoke:
 *             Function: std:join
 *             Arguments:
 *               separator: ','
 *               input: ${["example-2"].addressSpaces}
 *             Return: result
 *   example-2VirtualNetworkPeering:
 *     type: azure:network:VirtualNetworkPeering
 *     name: example-2
 *     properties:
 *       name: peer2to1
 *       resourceGroupName: ${example.name}
 *       virtualNetworkName: ${["example-2"].name}
 *       remoteVirtualNetworkId: ${["example-1"].id}
 *       triggers:
 *         remote_address_space:
 *           fn::invoke:
 *             Function: std:join
 *             Arguments:
 *               separator: ','
 *               input: ${["example-1"].addressSpaces}
 *             Return: result
 * ```
 * 
 * ## Note
 * Virtual Network peerings cannot be created, updated or deleted concurrently.
 * ## Import
 * Virtual Network Peerings can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/virtualNetworkPeering:VirtualNetworkPeering examplePeering /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/virtualNetworks/myvnet1/virtualNetworkPeerings/myvnet1peering
 * ```
 * @property allowForwardedTraffic Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to `false`.
 * @property allowGatewayTransit Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to `false`.
 * @property allowVirtualNetworkAccess Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to `true`.
 * @property name The name of the virtual network peering. Changing this forces a new resource to be created.
 * @property remoteVirtualNetworkId The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.
 * @property triggers A mapping of key values pairs that can be used to sync network routes from the remote virtual network to the local virtual network. See the trigger example for an example on how to set it up.
 * @property useRemoteGateways 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`.
 * > **NOTE:** `use_remote_gateways` must be set to `false` if using Global Virtual Network Peerings.
 * @property virtualNetworkName The name of the virtual network. Changing this forces a new resource to be created.
 */
public data class VirtualNetworkPeeringArgs(
    public val allowForwardedTraffic: Output? = null,
    public val allowGatewayTransit: Output? = null,
    public val allowVirtualNetworkAccess: Output? = null,
    public val name: Output? = null,
    public val remoteVirtualNetworkId: Output? = null,
    public val resourceGroupName: Output? = null,
    public val triggers: Output>? = null,
    public val useRemoteGateways: Output? = null,
    public val virtualNetworkName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.network.VirtualNetworkPeeringArgs =
        com.pulumi.azure.network.VirtualNetworkPeeringArgs.builder()
            .allowForwardedTraffic(allowForwardedTraffic?.applyValue({ args0 -> args0 }))
            .allowGatewayTransit(allowGatewayTransit?.applyValue({ args0 -> args0 }))
            .allowVirtualNetworkAccess(allowVirtualNetworkAccess?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .remoteVirtualNetworkId(remoteVirtualNetworkId?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .triggers(
                triggers?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .useRemoteGateways(useRemoteGateways?.applyValue({ args0 -> args0 }))
            .virtualNetworkName(virtualNetworkName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [VirtualNetworkPeeringArgs].
 */
@PulumiTagMarker
public class VirtualNetworkPeeringArgsBuilder internal constructor() {
    private var allowForwardedTraffic: Output? = null

    private var allowGatewayTransit: Output? = null

    private var allowVirtualNetworkAccess: Output? = null

    private var name: Output? = null

    private var remoteVirtualNetworkId: Output? = null

    private var resourceGroupName: Output? = null

    private var triggers: Output>? = null

    private var useRemoteGateways: Output? = null

    private var virtualNetworkName: Output? = null

    /**
     * @param value Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to `false`.
     */
    @JvmName("nslckbakkinhleik")
    public suspend fun allowForwardedTraffic(`value`: Output) {
        this.allowForwardedTraffic = value
    }

    /**
     * @param value Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to `false`.
     */
    @JvmName("cdrxebebhukjxvyo")
    public suspend fun allowGatewayTransit(`value`: Output) {
        this.allowGatewayTransit = value
    }

    /**
     * @param value Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to `true`.
     */
    @JvmName("stdewfbijyfcpixg")
    public suspend fun allowVirtualNetworkAccess(`value`: Output) {
        this.allowVirtualNetworkAccess = value
    }

    /**
     * @param value The name of the virtual network peering. Changing this forces a new resource to be created.
     */
    @JvmName("glxlmtfaosempcwx")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
     */
    @JvmName("bppvyknjugxaclrr")
    public suspend fun remoteVirtualNetworkId(`value`: Output) {
        this.remoteVirtualNetworkId = value
    }

    /**
     * @param value The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.
     */
    @JvmName("yudfurwyeeoojwmg")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value A mapping of key values pairs that can be used to sync network routes from the remote virtual network to the local virtual network. See the trigger example for an example on how to set it up.
     */
    @JvmName("bilomfjqeiqjsyco")
    public suspend fun triggers(`value`: Output>) {
        this.triggers = value
    }

    /**
     * @param value 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`.
     * > **NOTE:** `use_remote_gateways` must be set to `false` if using Global Virtual Network Peerings.
     */
    @JvmName("npdsluyxsvmgkydt")
    public suspend fun useRemoteGateways(`value`: Output) {
        this.useRemoteGateways = value
    }

    /**
     * @param value The name of the virtual network. Changing this forces a new resource to be created.
     */
    @JvmName("gsnpahegiheobglx")
    public suspend fun virtualNetworkName(`value`: Output) {
        this.virtualNetworkName = value
    }

    /**
     * @param value Controls if forwarded traffic from VMs in the remote virtual network is allowed. Defaults to `false`.
     */
    @JvmName("onwywhpxlsnchxed")
    public suspend fun allowForwardedTraffic(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowForwardedTraffic = mapped
    }

    /**
     * @param value Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network. Defaults to `false`.
     */
    @JvmName("pmddovvxsyukmdoo")
    public suspend fun allowGatewayTransit(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowGatewayTransit = mapped
    }

    /**
     * @param value Controls if the VMs in the remote virtual network can access VMs in the local virtual network. Defaults to `true`.
     */
    @JvmName("blgprrcywcmstswk")
    public suspend fun allowVirtualNetworkAccess(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowVirtualNetworkAccess = mapped
    }

    /**
     * @param value The name of the virtual network peering. Changing this forces a new resource to be created.
     */
    @JvmName("sxgonquweehmrdah")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
     */
    @JvmName("vhjuktgxxjdrrdsr")
    public suspend fun remoteVirtualNetworkId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.remoteVirtualNetworkId = mapped
    }

    /**
     * @param value The name of the resource group in which to create the virtual network peering. Changing this forces a new resource to be created.
     */
    @JvmName("njrptfgflswoincx")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value A mapping of key values pairs that can be used to sync network routes from the remote virtual network to the local virtual network. See the trigger example for an example on how to set it up.
     */
    @JvmName("ndddwsdnqmpborpr")
    public suspend fun triggers(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.triggers = mapped
    }

    /**
     * @param values A mapping of key values pairs that can be used to sync network routes from the remote virtual network to the local virtual network. See the trigger example for an example on how to set it up.
     */
    @JvmName("vbmelwiubrxsfcku")
    public fun triggers(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.triggers = mapped
    }

    /**
     * @param value 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`.
     * > **NOTE:** `use_remote_gateways` must be set to `false` if using Global Virtual Network Peerings.
     */
    @JvmName("ulavmpyidrueqysx")
    public suspend fun useRemoteGateways(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.useRemoteGateways = mapped
    }

    /**
     * @param value The name of the virtual network. Changing this forces a new resource to be created.
     */
    @JvmName("jvekqdfdfydjuqte")
    public suspend fun virtualNetworkName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.virtualNetworkName = mapped
    }

    internal fun build(): VirtualNetworkPeeringArgs = VirtualNetworkPeeringArgs(
        allowForwardedTraffic = allowForwardedTraffic,
        allowGatewayTransit = allowGatewayTransit,
        allowVirtualNetworkAccess = allowVirtualNetworkAccess,
        name = name,
        remoteVirtualNetworkId = remoteVirtualNetworkId,
        resourceGroupName = resourceGroupName,
        triggers = triggers,
        useRemoteGateways = useRemoteGateways,
        virtualNetworkName = virtualNetworkName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy