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

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

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.15.0.0
Show newest version
@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.List
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": pulumi.String(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": pulumi.String(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 traffic from the local virtual network can reach the remote virtual network. Defaults to `true`.
 * @property localSubnetNames A list of local Subnet names that are Subnet peered with remote Virtual Network.
 * @property name The name of the virtual network peering. Changing this forces a new resource to be created.
 * @property onlyIpv6PeeringEnabled Specifies whether only IPv6 address space is peered for Subnet peering. Changing this forces a new resource to be created.
 * @property peerCompleteVirtualNetworksEnabled Specifies whether complete Virtual Network address space is peered. Defaults to `true`. Changing this forces a new resource to be created.
 * @property remoteSubnetNames A list of remote Subnet names from remote Virtual Network that are Subnet peered.
 * @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 localSubnetNames: Output>? = null,
    public val name: Output? = null,
    public val onlyIpv6PeeringEnabled: Output? = null,
    public val peerCompleteVirtualNetworksEnabled: Output? = null,
    public val remoteSubnetNames: 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 }))
            .localSubnetNames(localSubnetNames?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .onlyIpv6PeeringEnabled(onlyIpv6PeeringEnabled?.applyValue({ args0 -> args0 }))
            .peerCompleteVirtualNetworksEnabled(
                peerCompleteVirtualNetworksEnabled?.applyValue({ args0 ->
                    args0
                }),
            )
            .remoteSubnetNames(remoteSubnetNames?.applyValue({ args0 -> args0.map({ 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 localSubnetNames: Output>? = null

    private var name: Output? = null

    private var onlyIpv6PeeringEnabled: Output? = null

    private var peerCompleteVirtualNetworksEnabled: Output? = null

    private var remoteSubnetNames: 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("cxdopuftkawqiohr")
    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("vcvqiffahfycibec")
    public suspend fun allowGatewayTransit(`value`: Output) {
        this.allowGatewayTransit = value
    }

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

    /**
     * @param value A list of local Subnet names that are Subnet peered with remote Virtual Network.
     */
    @JvmName("ngxjtstdlgeffnbl")
    public suspend fun localSubnetNames(`value`: Output>) {
        this.localSubnetNames = value
    }

    @JvmName("njjnyywrukttneao")
    public suspend fun localSubnetNames(vararg values: Output) {
        this.localSubnetNames = Output.all(values.asList())
    }

    /**
     * @param values A list of local Subnet names that are Subnet peered with remote Virtual Network.
     */
    @JvmName("kqfrcfotuumtdkuc")
    public suspend fun localSubnetNames(values: List>) {
        this.localSubnetNames = Output.all(values)
    }

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

    /**
     * @param value Specifies whether only IPv6 address space is peered for Subnet peering. Changing this forces a new resource to be created.
     */
    @JvmName("eodttggrdkjdllel")
    public suspend fun onlyIpv6PeeringEnabled(`value`: Output) {
        this.onlyIpv6PeeringEnabled = value
    }

    /**
     * @param value Specifies whether complete Virtual Network address space is peered. Defaults to `true`. Changing this forces a new resource to be created.
     */
    @JvmName("nrmrtmcuuujhcdmi")
    public suspend fun peerCompleteVirtualNetworksEnabled(`value`: Output) {
        this.peerCompleteVirtualNetworksEnabled = value
    }

    /**
     * @param value A list of remote Subnet names from remote Virtual Network that are Subnet peered.
     */
    @JvmName("wpaaurjxldmmpwii")
    public suspend fun remoteSubnetNames(`value`: Output>) {
        this.remoteSubnetNames = value
    }

    @JvmName("qyojabxvxhpcbwtm")
    public suspend fun remoteSubnetNames(vararg values: Output) {
        this.remoteSubnetNames = Output.all(values.asList())
    }

    /**
     * @param values A list of remote Subnet names from remote Virtual Network that are Subnet peered.
     */
    @JvmName("wrpdtmwyuxlcuhsu")
    public suspend fun remoteSubnetNames(values: List>) {
        this.remoteSubnetNames = Output.all(values)
    }

    /**
     * @param value The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
     */
    @JvmName("vuitsqnhcmitgwrc")
    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("uworsdruekopxehy")
    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("centiaembugpvrfg")
    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("grdfpwxjwvmiusml")
    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("hkqsjasboexbgjvc")
    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("jnqvaruyqyuluiam")
    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("kxywiijsfryxnybs")
    public suspend fun allowGatewayTransit(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowGatewayTransit = mapped
    }

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

    /**
     * @param value A list of local Subnet names that are Subnet peered with remote Virtual Network.
     */
    @JvmName("cxubymgogscoaprn")
    public suspend fun localSubnetNames(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.localSubnetNames = mapped
    }

    /**
     * @param values A list of local Subnet names that are Subnet peered with remote Virtual Network.
     */
    @JvmName("ndpbpnytnmndmdcv")
    public suspend fun localSubnetNames(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.localSubnetNames = mapped
    }

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

    /**
     * @param value Specifies whether only IPv6 address space is peered for Subnet peering. Changing this forces a new resource to be created.
     */
    @JvmName("iklapoahuvqlmuow")
    public suspend fun onlyIpv6PeeringEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.onlyIpv6PeeringEnabled = mapped
    }

    /**
     * @param value Specifies whether complete Virtual Network address space is peered. Defaults to `true`. Changing this forces a new resource to be created.
     */
    @JvmName("jdwnapiebgenaoex")
    public suspend fun peerCompleteVirtualNetworksEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.peerCompleteVirtualNetworksEnabled = mapped
    }

    /**
     * @param value A list of remote Subnet names from remote Virtual Network that are Subnet peered.
     */
    @JvmName("srsaotcsvnaatmdc")
    public suspend fun remoteSubnetNames(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.remoteSubnetNames = mapped
    }

    /**
     * @param values A list of remote Subnet names from remote Virtual Network that are Subnet peered.
     */
    @JvmName("aoisjjaisdndnmro")
    public suspend fun remoteSubnetNames(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.remoteSubnetNames = mapped
    }

    /**
     * @param value The full Azure resource ID of the remote virtual network. Changing this forces a new resource to be created.
     */
    @JvmName("tosdkriulybvsjbh")
    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("xcqjcnekrrbnwysi")
    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("sjxsmpquobaywprv")
    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("pvlxxtlaredgtjpp")
    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("swpoacirmvycipxf")
    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("jbqtcdudiltntjac")
    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,
        localSubnetNames = localSubnetNames,
        name = name,
        onlyIpv6PeeringEnabled = onlyIpv6PeeringEnabled,
        peerCompleteVirtualNetworksEnabled = peerCompleteVirtualNetworksEnabled,
        remoteSubnetNames = remoteSubnetNames,
        remoteVirtualNetworkId = remoteVirtualNetworkId,
        resourceGroupName = resourceGroupName,
        triggers = triggers,
        useRemoteGateways = useRemoteGateways,
        virtualNetworkName = virtualNetworkName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy