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

com.pulumi.azurenative.azurestackhci.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.azurestackhci.kotlin

import com.pulumi.azurenative.azurestackhci.VirtualNetworkArgs.builder
import com.pulumi.azurenative.azurestackhci.kotlin.enums.NetworkTypeEnum
import com.pulumi.azurenative.azurestackhci.kotlin.inputs.ExtendedLocationArgs
import com.pulumi.azurenative.azurestackhci.kotlin.inputs.ExtendedLocationArgsBuilder
import com.pulumi.azurenative.azurestackhci.kotlin.inputs.VirtualNetworkPropertiesDhcpOptionsArgs
import com.pulumi.azurenative.azurestackhci.kotlin.inputs.VirtualNetworkPropertiesDhcpOptionsArgsBuilder
import com.pulumi.azurenative.azurestackhci.kotlin.inputs.VirtualNetworkPropertiesSubnetsArgs
import com.pulumi.azurenative.azurestackhci.kotlin.inputs.VirtualNetworkPropertiesSubnetsArgsBuilder
import com.pulumi.core.Either
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * The virtual network resource definition.
 * Azure REST API version: 2022-12-15-preview.
 * Other available API versions: 2023-07-01-preview.
 * ## Example Usage
 * ### PutVirtualNetwork
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var virtualNetwork = new AzureNative.AzureStackHCI.VirtualNetwork("virtualNetwork", new()
 *     {
 *         ExtendedLocation = new AzureNative.AzureStackHCI.Inputs.ExtendedLocationArgs
 *         {
 *             Name = "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
 *             Type = AzureNative.AzureStackHCI.ExtendedLocationTypes.CustomLocation,
 *         },
 *         Location = "West US2",
 *         NetworkType = AzureNative.AzureStackHCI.NetworkTypeEnum.Transparent,
 *         ResourceGroupName = "test-rg",
 *         VirtualNetworkName = "test-vnet",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	azurestackhci "github.com/pulumi/pulumi-azure-native-sdk/azurestackhci/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := azurestackhci.NewVirtualNetwork(ctx, "virtualNetwork", &azurestackhci.VirtualNetworkArgs{
 * 			ExtendedLocation: &azurestackhci.ExtendedLocationArgs{
 * 				Name: pulumi.String("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"),
 * 				Type: pulumi.String(azurestackhci.ExtendedLocationTypesCustomLocation),
 * 			},
 * 			Location:           pulumi.String("West US2"),
 * 			NetworkType:        pulumi.String(azurestackhci.NetworkTypeEnumTransparent),
 * 			ResourceGroupName:  pulumi.String("test-rg"),
 * 			VirtualNetworkName: pulumi.String("test-vnet"),
 * 		})
 * 		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.azurenative.azurestackhci.VirtualNetwork;
 * import com.pulumi.azurenative.azurestackhci.VirtualNetworkArgs;
 * import com.pulumi.azurenative.azurestackhci.inputs.ExtendedLocationArgs;
 * 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 virtualNetwork = new VirtualNetwork("virtualNetwork", VirtualNetworkArgs.builder()
 *             .extendedLocation(ExtendedLocationArgs.builder()
 *                 .name("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")
 *                 .type("CustomLocation")
 *                 .build())
 *             .location("West US2")
 *             .networkType("Transparent")
 *             .resourceGroupName("test-rg")
 *             .virtualNetworkName("test-vnet")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:azurestackhci:VirtualNetwork test-vnet /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualNetworks/{virtualNetworkName}
 * ```
 * @property dhcpOptions DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option for a subnet overrides VNET DHCP options.
 * @property extendedLocation The extendedLocation of the resource.
 * @property location The geo-location where the resource lives
 * @property networkType Type of the network
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 * @property subnets Subnet - list of subnets under the virtual network
 * @property tags Resource tags.
 * @property virtualNetworkName Name of the virtual network
 * @property vmSwitchName name of the network switch to be used for VMs
 */
public data class VirtualNetworkArgs(
    public val dhcpOptions: Output? = null,
    public val extendedLocation: Output? = null,
    public val location: Output? = null,
    public val networkType: Output>? = null,
    public val resourceGroupName: Output? = null,
    public val subnets: Output>? = null,
    public val tags: Output>? = null,
    public val virtualNetworkName: Output? = null,
    public val vmSwitchName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.azurestackhci.VirtualNetworkArgs =
        com.pulumi.azurenative.azurestackhci.VirtualNetworkArgs.builder()
            .dhcpOptions(dhcpOptions?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .extendedLocation(extendedLocation?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .networkType(
                networkType?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .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() }))
            .virtualNetworkName(virtualNetworkName?.applyValue({ args0 -> args0 }))
            .vmSwitchName(vmSwitchName?.applyValue({ args0 -> args0 })).build()
}

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

    private var extendedLocation: Output? = null

    private var location: Output? = null

    private var networkType: Output>? = null

    private var resourceGroupName: Output? = null

    private var subnets: Output>? = null

    private var tags: Output>? = null

    private var virtualNetworkName: Output? = null

    private var vmSwitchName: Output? = null

    /**
     * @param value DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option for a subnet overrides VNET DHCP options.
     */
    @JvmName("tvlncylntkfkrdni")
    public suspend fun dhcpOptions(`value`: Output) {
        this.dhcpOptions = value
    }

    /**
     * @param value The extendedLocation of the resource.
     */
    @JvmName("shtnoltqstrkcooj")
    public suspend fun extendedLocation(`value`: Output) {
        this.extendedLocation = value
    }

    /**
     * @param value The geo-location where the resource lives
     */
    @JvmName("gklittypodtwrkdj")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Type of the network
     */
    @JvmName("lnhdtwrslulfmqef")
    public suspend fun networkType(`value`: Output>) {
        this.networkType = value
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("ryqbghhedbsqkylj")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Subnet - list of subnets under the virtual network
     */
    @JvmName("aqxqubhmkchgkibu")
    public suspend fun subnets(`value`: Output>) {
        this.subnets = value
    }

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

    /**
     * @param values Subnet - list of subnets under the virtual network
     */
    @JvmName("qxhjlbochcwepecu")
    public suspend fun subnets(values: List>) {
        this.subnets = Output.all(values)
    }

    /**
     * @param value Resource tags.
     */
    @JvmName("prvonwqrublmvwtm")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Name of the virtual network
     */
    @JvmName("yrrvflnaxpmuypsf")
    public suspend fun virtualNetworkName(`value`: Output) {
        this.virtualNetworkName = value
    }

    /**
     * @param value name of the network switch to be used for VMs
     */
    @JvmName("vhvhmcdejttemjuu")
    public suspend fun vmSwitchName(`value`: Output) {
        this.vmSwitchName = value
    }

    /**
     * @param value DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option for a subnet overrides VNET DHCP options.
     */
    @JvmName("cehlfgmvaxeipclt")
    public suspend fun dhcpOptions(`value`: VirtualNetworkPropertiesDhcpOptionsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dhcpOptions = mapped
    }

    /**
     * @param argument DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option for a subnet overrides VNET DHCP options.
     */
    @JvmName("mbrvcdvviqhumnvh")
    public suspend fun dhcpOptions(argument: suspend VirtualNetworkPropertiesDhcpOptionsArgsBuilder.() -> Unit) {
        val toBeMapped = VirtualNetworkPropertiesDhcpOptionsArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.dhcpOptions = mapped
    }

    /**
     * @param value The extendedLocation of the resource.
     */
    @JvmName("dfhhxsnesqfvuvjo")
    public suspend fun extendedLocation(`value`: ExtendedLocationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.extendedLocation = mapped
    }

    /**
     * @param argument The extendedLocation of the resource.
     */
    @JvmName("cmgakivmeylxibxh")
    public suspend fun extendedLocation(argument: suspend ExtendedLocationArgsBuilder.() -> Unit) {
        val toBeMapped = ExtendedLocationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.extendedLocation = mapped
    }

    /**
     * @param value The geo-location where the resource lives
     */
    @JvmName("codwvwlydxxkgqwn")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Type of the network
     */
    @JvmName("ihpphggdshwqohkv")
    public suspend fun networkType(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networkType = mapped
    }

    /**
     * @param value Type of the network
     */
    @JvmName("ngbwjewqgghafkdn")
    public fun networkType(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.networkType = mapped
    }

    /**
     * @param value Type of the network
     */
    @JvmName("unuxwoylmotkcxym")
    public fun networkType(`value`: NetworkTypeEnum) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.networkType = mapped
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("ysuqlahkpvlpshef")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Subnet - list of subnets under the virtual network
     */
    @JvmName("gktyckfqeknrnxwo")
    public suspend fun subnets(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subnets = mapped
    }

    /**
     * @param argument Subnet - list of subnets under the virtual network
     */
    @JvmName("iigmsssqcriipjcr")
    public suspend fun subnets(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            VirtualNetworkPropertiesSubnetsArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.subnets = mapped
    }

    /**
     * @param argument Subnet - list of subnets under the virtual network
     */
    @JvmName("rubppnsixtuddpvk")
    public suspend fun subnets(vararg argument: suspend VirtualNetworkPropertiesSubnetsArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            VirtualNetworkPropertiesSubnetsArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.subnets = mapped
    }

    /**
     * @param argument Subnet - list of subnets under the virtual network
     */
    @JvmName("bfvcopttdcaniocb")
    public suspend fun subnets(argument: suspend VirtualNetworkPropertiesSubnetsArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            VirtualNetworkPropertiesSubnetsArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.subnets = mapped
    }

    /**
     * @param values Subnet - list of subnets under the virtual network
     */
    @JvmName("mgvvckkkrxnvashj")
    public suspend fun subnets(vararg values: VirtualNetworkPropertiesSubnetsArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.subnets = mapped
    }

    /**
     * @param value Resource tags.
     */
    @JvmName("jjivvemjmxmpayiv")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Resource tags.
     */
    @JvmName("ouglspuyenlecmju")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value Name of the virtual network
     */
    @JvmName("uqpyxegwcvglwrrs")
    public suspend fun virtualNetworkName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.virtualNetworkName = mapped
    }

    /**
     * @param value name of the network switch to be used for VMs
     */
    @JvmName("wxytoarmdtfcoees")
    public suspend fun vmSwitchName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vmSwitchName = mapped
    }

    internal fun build(): VirtualNetworkArgs = VirtualNetworkArgs(
        dhcpOptions = dhcpOptions,
        extendedLocation = extendedLocation,
        location = location,
        networkType = networkType,
        resourceGroupName = resourceGroupName,
        subnets = subnets,
        tags = tags,
        virtualNetworkName = virtualNetworkName,
        vmSwitchName = vmSwitchName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy