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

com.pulumi.azure.network.kotlin.VirtualNetworkArgs.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.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.network.kotlin

import com.pulumi.azure.network.VirtualNetworkArgs.builder
import com.pulumi.azure.network.kotlin.inputs.VirtualNetworkDdosProtectionPlanArgs
import com.pulumi.azure.network.kotlin.inputs.VirtualNetworkDdosProtectionPlanArgsBuilder
import com.pulumi.azure.network.kotlin.inputs.VirtualNetworkEncryptionArgs
import com.pulumi.azure.network.kotlin.inputs.VirtualNetworkEncryptionArgsBuilder
import com.pulumi.azure.network.kotlin.inputs.VirtualNetworkSubnetArgs
import com.pulumi.azure.network.kotlin.inputs.VirtualNetworkSubnetArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a virtual network including any configured subnets. Each subnet can
 * optionally be configured with a security group to be associated with the subnet.
 * > **NOTE on Virtual Networks and Subnet's:** This provider currently
 * provides both a standalone Subnet resource, and allows for Subnets to be defined in-line within the Virtual Network resource.
 * At this time you cannot use a Virtual Network with in-line Subnets in conjunction with any Subnet resources. Doing so will cause a conflict of Subnet configurations and will overwrite Subnet's.
 * > **NOTE on Virtual Networks and DNS Servers:** This provider currently provides both a standalone virtual network DNS Servers resource, and allows for DNS servers to be defined in-line within the Virtual Network resource.
 * At this time you cannot use a Virtual Network with in-line DNS servers in conjunction with any Virtual Network DNS Servers resources. Doing so will cause a conflict of Virtual Network DNS Servers configurations and will overwrite virtual networks DNS servers.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("example", {
 *     name: "example-security-group",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "example-network",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     addressSpaces: ["10.0.0.0/16"],
 *     dnsServers: [
 *         "10.0.0.4",
 *         "10.0.0.5",
 *     ],
 *     subnets: [
 *         {
 *             name: "subnet1",
 *             addressPrefix: "10.0.1.0/24",
 *         },
 *         {
 *             name: "subnet2",
 *             addressPrefix: "10.0.2.0/24",
 *             securityGroup: exampleNetworkSecurityGroup.id,
 *         },
 *     ],
 *     tags: {
 *         environment: "Production",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_network_security_group = azure.network.NetworkSecurityGroup("example",
 *     name="example-security-group",
 *     location=example.location,
 *     resource_group_name=example.name)
 * example_virtual_network = azure.network.VirtualNetwork("example",
 *     name="example-network",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     address_spaces=["10.0.0.0/16"],
 *     dns_servers=[
 *         "10.0.0.4",
 *         "10.0.0.5",
 *     ],
 *     subnets=[
 *         azure.network.VirtualNetworkSubnetArgs(
 *             name="subnet1",
 *             address_prefix="10.0.1.0/24",
 *         ),
 *         azure.network.VirtualNetworkSubnetArgs(
 *             name="subnet2",
 *             address_prefix="10.0.2.0/24",
 *             security_group=example_network_security_group.id,
 *         ),
 *     ],
 *     tags={
 *         "environment": "Production",
 *     })
 * ```
 * ```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 = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("example", new()
 *     {
 *         Name = "example-security-group",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *     });
 *     var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
 *     {
 *         Name = "example-network",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         AddressSpaces = new[]
 *         {
 *             "10.0.0.0/16",
 *         },
 *         DnsServers = new[]
 *         {
 *             "10.0.0.4",
 *             "10.0.0.5",
 *         },
 *         Subnets = new[]
 *         {
 *             new Azure.Network.Inputs.VirtualNetworkSubnetArgs
 *             {
 *                 Name = "subnet1",
 *                 AddressPrefix = "10.0.1.0/24",
 *             },
 *             new Azure.Network.Inputs.VirtualNetworkSubnetArgs
 *             {
 *                 Name = "subnet2",
 *                 AddressPrefix = "10.0.2.0/24",
 *                 SecurityGroup = exampleNetworkSecurityGroup.Id,
 *             },
 *         },
 *         Tags =
 *         {
 *             { "environment", "Production" },
 *         },
 *     });
 * });
 * ```
 * ```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("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "example", &network.NetworkSecurityGroupArgs{
 * 			Name:              pulumi.String("example-security-group"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
 * 			Name:              pulumi.String("example-network"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			AddressSpaces: pulumi.StringArray{
 * 				pulumi.String("10.0.0.0/16"),
 * 			},
 * 			DnsServers: pulumi.StringArray{
 * 				pulumi.String("10.0.0.4"),
 * 				pulumi.String("10.0.0.5"),
 * 			},
 * 			Subnets: network.VirtualNetworkSubnetArray{
 * 				&network.VirtualNetworkSubnetArgs{
 * 					Name:          pulumi.String("subnet1"),
 * 					AddressPrefix: pulumi.String("10.0.1.0/24"),
 * 				},
 * 				&network.VirtualNetworkSubnetArgs{
 * 					Name:          pulumi.String("subnet2"),
 * 					AddressPrefix: pulumi.String("10.0.2.0/24"),
 * 					SecurityGroup: exampleNetworkSecurityGroup.ID(),
 * 				},
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"environment": pulumi.String("Production"),
 * 			},
 * 		})
 * 		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.NetworkSecurityGroup;
 * import com.pulumi.azure.network.NetworkSecurityGroupArgs;
 * import com.pulumi.azure.network.VirtualNetwork;
 * import com.pulumi.azure.network.VirtualNetworkArgs;
 * import com.pulumi.azure.network.inputs.VirtualNetworkSubnetArgs;
 * 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("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleNetworkSecurityGroup = new NetworkSecurityGroup("exampleNetworkSecurityGroup", NetworkSecurityGroupArgs.builder()
 *             .name("example-security-group")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 *         var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
 *             .name("example-network")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .addressSpaces("10.0.0.0/16")
 *             .dnsServers(
 *                 "10.0.0.4",
 *                 "10.0.0.5")
 *             .subnets(
 *                 VirtualNetworkSubnetArgs.builder()
 *                     .name("subnet1")
 *                     .addressPrefix("10.0.1.0/24")
 *                     .build(),
 *                 VirtualNetworkSubnetArgs.builder()
 *                     .name("subnet2")
 *                     .addressPrefix("10.0.2.0/24")
 *                     .securityGroup(exampleNetworkSecurityGroup.id())
 *                     .build())
 *             .tags(Map.of("environment", "Production"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleNetworkSecurityGroup:
 *     type: azure:network:NetworkSecurityGroup
 *     name: example
 *     properties:
 *       name: example-security-group
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *   exampleVirtualNetwork:
 *     type: azure:network:VirtualNetwork
 *     name: example
 *     properties:
 *       name: example-network
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       addressSpaces:
 *         - 10.0.0.0/16
 *       dnsServers:
 *         - 10.0.0.4
 *         - 10.0.0.5
 *       subnets:
 *         - name: subnet1
 *           addressPrefix: 10.0.1.0/24
 *         - name: subnet2
 *           addressPrefix: 10.0.2.0/24
 *           securityGroup: ${exampleNetworkSecurityGroup.id}
 *       tags:
 *         environment: Production
 * ```
 * 
 * ## Import
 * Virtual Networks can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/virtualNetwork:VirtualNetwork exampleNetwork /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/virtualNetworks/myvnet1
 * ```
 * @property addressSpaces The address space that is used the virtual network. You can supply more than one address space.
 * @property bgpCommunity The BGP community attribute in format `:`.
 * > **NOTE** The `as-number` segment is the Microsoft ASN, which is always `12076` for now.
 * @property ddosProtectionPlan A `ddos_protection_plan` block as documented below.
 * @property dnsServers List of IP addresses of DNS servers
 * > **NOTE** Since `dns_servers` can be configured both inline and via the separate `azure.network.VirtualNetworkDnsServers` resource, we have to explicitly set it to empty slice (`[]`) to remove it.
 * @property edgeZone Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.
 * @property encryption A `encryption` block as defined below.
 * @property flowTimeoutInMinutes The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between `4` and `30` minutes.
 * @property location The location/region where the virtual network is created. Changing this forces a new resource to be created.
 * @property name The name of the 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. Changing this forces a new resource to be created.
 * @property subnets Can be specified multiple times to define multiple subnets. Each `subnet` block supports fields documented below.
 * > **NOTE** Since `subnet` can be configured both inline and via the separate `azure.network.Subnet` resource, we have to explicitly set it to empty slice (`[]`) to remove it.
 * @property tags A mapping of tags to assign to the resource.
 */
public data class VirtualNetworkArgs(
    public val addressSpaces: Output>? = null,
    public val bgpCommunity: Output? = null,
    public val ddosProtectionPlan: Output? = null,
    public val dnsServers: Output>? = null,
    public val edgeZone: Output? = null,
    public val encryption: Output? = null,
    public val flowTimeoutInMinutes: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val subnets: Output>? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.network.VirtualNetworkArgs =
        com.pulumi.azure.network.VirtualNetworkArgs.builder()
            .addressSpaces(addressSpaces?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .bgpCommunity(bgpCommunity?.applyValue({ args0 -> args0 }))
            .ddosProtectionPlan(
                ddosProtectionPlan?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .dnsServers(dnsServers?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .edgeZone(edgeZone?.applyValue({ args0 -> args0 }))
            .encryption(encryption?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .flowTimeoutInMinutes(flowTimeoutInMinutes?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .subnets(
                subnets?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [VirtualNetworkArgs].
 */
@PulumiTagMarker
public class VirtualNetworkArgsBuilder internal constructor() {
    private var addressSpaces: Output>? = null

    private var bgpCommunity: Output? = null

    private var ddosProtectionPlan: Output? = null

    private var dnsServers: Output>? = null

    private var edgeZone: Output? = null

    private var encryption: Output? = null

    private var flowTimeoutInMinutes: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var subnets: Output>? = null

    private var tags: Output>? = null

    /**
     * @param value The address space that is used the virtual network. You can supply more than one address space.
     */
    @JvmName("kxwyrxajptmowsde")
    public suspend fun addressSpaces(`value`: Output>) {
        this.addressSpaces = value
    }

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

    /**
     * @param values The address space that is used the virtual network. You can supply more than one address space.
     */
    @JvmName("tjamdmqqxdtugdna")
    public suspend fun addressSpaces(values: List>) {
        this.addressSpaces = Output.all(values)
    }

    /**
     * @param value The BGP community attribute in format `:`.
     * > **NOTE** The `as-number` segment is the Microsoft ASN, which is always `12076` for now.
     */
    @JvmName("uyqahslgmlsfcdix")
    public suspend fun bgpCommunity(`value`: Output) {
        this.bgpCommunity = value
    }

    /**
     * @param value A `ddos_protection_plan` block as documented below.
     */
    @JvmName("kwjocknfgnkiwglj")
    public suspend fun ddosProtectionPlan(`value`: Output) {
        this.ddosProtectionPlan = value
    }

    /**
     * @param value List of IP addresses of DNS servers
     * > **NOTE** Since `dns_servers` can be configured both inline and via the separate `azure.network.VirtualNetworkDnsServers` resource, we have to explicitly set it to empty slice (`[]`) to remove it.
     */
    @JvmName("rohsjisfhbfhqpuh")
    public suspend fun dnsServers(`value`: Output>) {
        this.dnsServers = value
    }

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

    /**
     * @param values List of IP addresses of DNS servers
     * > **NOTE** Since `dns_servers` can be configured both inline and via the separate `azure.network.VirtualNetworkDnsServers` resource, we have to explicitly set it to empty slice (`[]`) to remove it.
     */
    @JvmName("cthjjwvbfmwygbrl")
    public suspend fun dnsServers(values: List>) {
        this.dnsServers = Output.all(values)
    }

    /**
     * @param value Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.
     */
    @JvmName("ovtxdthqnuknsjuj")
    public suspend fun edgeZone(`value`: Output) {
        this.edgeZone = value
    }

    /**
     * @param value A `encryption` block as defined below.
     */
    @JvmName("ywvndhfhwadjwifr")
    public suspend fun encryption(`value`: Output) {
        this.encryption = value
    }

    /**
     * @param value The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between `4` and `30` minutes.
     */
    @JvmName("oavxdihdsjnqxxbn")
    public suspend fun flowTimeoutInMinutes(`value`: Output) {
        this.flowTimeoutInMinutes = value
    }

    /**
     * @param value The location/region where the virtual network is created. Changing this forces a new resource to be created.
     */
    @JvmName("ljghelxrjhtdixme")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

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

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

    /**
     * @param value Can be specified multiple times to define multiple subnets. Each `subnet` block supports fields documented below.
     * > **NOTE** Since `subnet` can be configured both inline and via the separate `azure.network.Subnet` resource, we have to explicitly set it to empty slice (`[]`) to remove it.
     */
    @JvmName("wywkrydepevphgob")
    public suspend fun subnets(`value`: Output>) {
        this.subnets = value
    }

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

    /**
     * @param values Can be specified multiple times to define multiple subnets. Each `subnet` block supports fields documented below.
     * > **NOTE** Since `subnet` can be configured both inline and via the separate `azure.network.Subnet` resource, we have to explicitly set it to empty slice (`[]`) to remove it.
     */
    @JvmName("ltfaiidqewtonjlc")
    public suspend fun subnets(values: List>) {
        this.subnets = Output.all(values)
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("sqhimgygdnaljmsb")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The address space that is used the virtual network. You can supply more than one address space.
     */
    @JvmName("eexufoktltdipiva")
    public suspend fun addressSpaces(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.addressSpaces = mapped
    }

    /**
     * @param values The address space that is used the virtual network. You can supply more than one address space.
     */
    @JvmName("nuhqbbexynakrumo")
    public suspend fun addressSpaces(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.addressSpaces = mapped
    }

    /**
     * @param value The BGP community attribute in format `:`.
     * > **NOTE** The `as-number` segment is the Microsoft ASN, which is always `12076` for now.
     */
    @JvmName("lwumkkgipdovmthf")
    public suspend fun bgpCommunity(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bgpCommunity = mapped
    }

    /**
     * @param value A `ddos_protection_plan` block as documented below.
     */
    @JvmName("wrhuivlpknrxykue")
    public suspend fun ddosProtectionPlan(`value`: VirtualNetworkDdosProtectionPlanArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ddosProtectionPlan = mapped
    }

    /**
     * @param argument A `ddos_protection_plan` block as documented below.
     */
    @JvmName("nrdybmplypdhbyhq")
    public suspend
    fun ddosProtectionPlan(argument: suspend VirtualNetworkDdosProtectionPlanArgsBuilder.() -> Unit) {
        val toBeMapped = VirtualNetworkDdosProtectionPlanArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.ddosProtectionPlan = mapped
    }

    /**
     * @param value List of IP addresses of DNS servers
     * > **NOTE** Since `dns_servers` can be configured both inline and via the separate `azure.network.VirtualNetworkDnsServers` resource, we have to explicitly set it to empty slice (`[]`) to remove it.
     */
    @JvmName("bcfareeslpjpoova")
    public suspend fun dnsServers(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dnsServers = mapped
    }

    /**
     * @param values List of IP addresses of DNS servers
     * > **NOTE** Since `dns_servers` can be configured both inline and via the separate `azure.network.VirtualNetworkDnsServers` resource, we have to explicitly set it to empty slice (`[]`) to remove it.
     */
    @JvmName("srabneawuuuxojqr")
    public suspend fun dnsServers(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.dnsServers = mapped
    }

    /**
     * @param value Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.
     */
    @JvmName("cldinvdqnneehcaj")
    public suspend fun edgeZone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.edgeZone = mapped
    }

    /**
     * @param value A `encryption` block as defined below.
     */
    @JvmName("clhfmnrovbdndyqg")
    public suspend fun encryption(`value`: VirtualNetworkEncryptionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.encryption = mapped
    }

    /**
     * @param argument A `encryption` block as defined below.
     */
    @JvmName("wdmhpenqxwbsuwuj")
    public suspend fun encryption(argument: suspend VirtualNetworkEncryptionArgsBuilder.() -> Unit) {
        val toBeMapped = VirtualNetworkEncryptionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.encryption = mapped
    }

    /**
     * @param value The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between `4` and `30` minutes.
     */
    @JvmName("riwqfshmsidabmth")
    public suspend fun flowTimeoutInMinutes(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.flowTimeoutInMinutes = mapped
    }

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

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

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

    /**
     * @param value Can be specified multiple times to define multiple subnets. Each `subnet` block supports fields documented below.
     * > **NOTE** Since `subnet` can be configured both inline and via the separate `azure.network.Subnet` resource, we have to explicitly set it to empty slice (`[]`) to remove it.
     */
    @JvmName("ecmfhyawiacylkhj")
    public suspend fun subnets(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subnets = mapped
    }

    /**
     * @param argument Can be specified multiple times to define multiple subnets. Each `subnet` block supports fields documented below.
     * > **NOTE** Since `subnet` can be configured both inline and via the separate `azure.network.Subnet` resource, we have to explicitly set it to empty slice (`[]`) to remove it.
     */
    @JvmName("ouyiupiabrtimcea")
    public suspend fun subnets(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            VirtualNetworkSubnetArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.subnets = mapped
    }

    /**
     * @param argument Can be specified multiple times to define multiple subnets. Each `subnet` block supports fields documented below.
     * > **NOTE** Since `subnet` can be configured both inline and via the separate `azure.network.Subnet` resource, we have to explicitly set it to empty slice (`[]`) to remove it.
     */
    @JvmName("qjfwcbmbjjrfxpvi")
    public suspend fun subnets(vararg argument: suspend VirtualNetworkSubnetArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            VirtualNetworkSubnetArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.subnets = mapped
    }

    /**
     * @param argument Can be specified multiple times to define multiple subnets. Each `subnet` block supports fields documented below.
     * > **NOTE** Since `subnet` can be configured both inline and via the separate `azure.network.Subnet` resource, we have to explicitly set it to empty slice (`[]`) to remove it.
     */
    @JvmName("mdmgpoofhsptuaqv")
    public suspend fun subnets(argument: suspend VirtualNetworkSubnetArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(VirtualNetworkSubnetArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.subnets = mapped
    }

    /**
     * @param values Can be specified multiple times to define multiple subnets. Each `subnet` block supports fields documented below.
     * > **NOTE** Since `subnet` can be configured both inline and via the separate `azure.network.Subnet` resource, we have to explicitly set it to empty slice (`[]`) to remove it.
     */
    @JvmName("rstvsjuvdvsrfpvd")
    public suspend fun subnets(vararg values: VirtualNetworkSubnetArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.subnets = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("txylerquoapilodv")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource.
     */
    @JvmName("ylwynvylotuiqyli")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): VirtualNetworkArgs = VirtualNetworkArgs(
        addressSpaces = addressSpaces,
        bgpCommunity = bgpCommunity,
        ddosProtectionPlan = ddosProtectionPlan,
        dnsServers = dnsServers,
        edgeZone = edgeZone,
        encryption = encryption,
        flowTimeoutInMinutes = flowTimeoutInMinutes,
        location = location,
        name = name,
        resourceGroupName = resourceGroupName,
        subnets = subnets,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy