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

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

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

package com.pulumi.azure.network.kotlin

import com.pulumi.azure.network.VirtualHubArgs.builder
import com.pulumi.azure.network.kotlin.inputs.VirtualHubRouteArgs
import com.pulumi.azure.network.kotlin.inputs.VirtualHubRouteArgsBuilder
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 Hub within a Virtual WAN.
 * ## 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 exampleVirtualWan = new azure.network.VirtualWan("example", {
 *     name: "example-virtualwan",
 *     resourceGroupName: example.name,
 *     location: example.location,
 * });
 * const exampleVirtualHub = new azure.network.VirtualHub("example", {
 *     name: "example-virtualhub",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     virtualWanId: exampleVirtualWan.id,
 *     addressPrefix: "10.0.0.0/23",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_virtual_wan = azure.network.VirtualWan("example",
 *     name="example-virtualwan",
 *     resource_group_name=example.name,
 *     location=example.location)
 * example_virtual_hub = azure.network.VirtualHub("example",
 *     name="example-virtualhub",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     virtual_wan_id=example_virtual_wan.id,
 *     address_prefix="10.0.0.0/23")
 * ```
 * ```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 exampleVirtualWan = new Azure.Network.VirtualWan("example", new()
 *     {
 *         Name = "example-virtualwan",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *     });
 *     var exampleVirtualHub = new Azure.Network.VirtualHub("example", new()
 *     {
 *         Name = "example-virtualhub",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         VirtualWanId = exampleVirtualWan.Id,
 *         AddressPrefix = "10.0.0.0/23",
 *     });
 * });
 * ```
 * ```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
 * 		}
 * 		exampleVirtualWan, err := network.NewVirtualWan(ctx, "example", &network.VirtualWanArgs{
 * 			Name:              pulumi.String("example-virtualwan"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewVirtualHub(ctx, "example", &network.VirtualHubArgs{
 * 			Name:              pulumi.String("example-virtualhub"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			VirtualWanId:      exampleVirtualWan.ID(),
 * 			AddressPrefix:     pulumi.String("10.0.0.0/23"),
 * 		})
 * 		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.VirtualWan;
 * import com.pulumi.azure.network.VirtualWanArgs;
 * import com.pulumi.azure.network.VirtualHub;
 * import com.pulumi.azure.network.VirtualHubArgs;
 * 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 exampleVirtualWan = new VirtualWan("exampleVirtualWan", VirtualWanArgs.builder()
 *             .name("example-virtualwan")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .build());
 *         var exampleVirtualHub = new VirtualHub("exampleVirtualHub", VirtualHubArgs.builder()
 *             .name("example-virtualhub")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .virtualWanId(exampleVirtualWan.id())
 *             .addressPrefix("10.0.0.0/23")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleVirtualWan:
 *     type: azure:network:VirtualWan
 *     name: example
 *     properties:
 *       name: example-virtualwan
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *   exampleVirtualHub:
 *     type: azure:network:VirtualHub
 *     name: example
 *     properties:
 *       name: example-virtualhub
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       virtualWanId: ${exampleVirtualWan.id}
 *       addressPrefix: 10.0.0.0/23
 * ```
 * 
 * ## Import
 * Virtual Hub's can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/virtualHub:VirtualHub example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/virtualHubs/hub1
 * ```
 * @property addressPrefix The Address Prefix which should be used for this Virtual Hub. Changing this forces a new resource to be created. [The address prefix subnet cannot be smaller than a `/24`. Azure recommends using a `/23`](https://docs.microsoft.com/azure/virtual-wan/virtual-wan-faq#what-is-the-recommended-hub-address-space-during-hub-creation).
 * @property hubRoutingPreference The hub routing preference. Possible values are `ExpressRoute`, `ASPath` and `VpnGateway`. Defaults to `ExpressRoute`.
 * @property location Specifies the supported Azure location where the Virtual Hub should exist. Changing this forces a new resource to be created.
 * @property name The name of the Virtual Hub. Changing this forces a new resource to be created.
 * @property resourceGroupName Specifies the name of the Resource Group where the Virtual Hub should exist. Changing this forces a new resource to be created.
 * @property routes One or more `route` blocks as defined below.
 * @property sku The SKU of the Virtual Hub. Possible values are `Basic` and `Standard`. Changing this forces a new resource to be created.
 * @property tags A mapping of tags to assign to the Virtual Hub.
 * @property virtualRouterAutoScaleMinCapacity Minimum instance capacity for the scaling configuration of the Virtual Hub Router.
 * @property virtualWanId The ID of a Virtual WAN within which the Virtual Hub should be created. Changing this forces a new resource to be created.
 */
public data class VirtualHubArgs(
    public val addressPrefix: Output? = null,
    public val hubRoutingPreference: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val routes: Output>? = null,
    public val sku: Output? = null,
    public val tags: Output>? = null,
    public val virtualRouterAutoScaleMinCapacity: Output? = null,
    public val virtualWanId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.network.VirtualHubArgs =
        com.pulumi.azure.network.VirtualHubArgs.builder()
            .addressPrefix(addressPrefix?.applyValue({ args0 -> args0 }))
            .hubRoutingPreference(hubRoutingPreference?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .routes(routes?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .sku(sku?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .virtualRouterAutoScaleMinCapacity(
                virtualRouterAutoScaleMinCapacity?.applyValue({ args0 ->
                    args0
                }),
            )
            .virtualWanId(virtualWanId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [VirtualHubArgs].
 */
@PulumiTagMarker
public class VirtualHubArgsBuilder internal constructor() {
    private var addressPrefix: Output? = null

    private var hubRoutingPreference: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var routes: Output>? = null

    private var sku: Output? = null

    private var tags: Output>? = null

    private var virtualRouterAutoScaleMinCapacity: Output? = null

    private var virtualWanId: Output? = null

    /**
     * @param value The Address Prefix which should be used for this Virtual Hub. Changing this forces a new resource to be created. [The address prefix subnet cannot be smaller than a `/24`. Azure recommends using a `/23`](https://docs.microsoft.com/azure/virtual-wan/virtual-wan-faq#what-is-the-recommended-hub-address-space-during-hub-creation).
     */
    @JvmName("aokqpdrqhedrmnhu")
    public suspend fun addressPrefix(`value`: Output) {
        this.addressPrefix = value
    }

    /**
     * @param value The hub routing preference. Possible values are `ExpressRoute`, `ASPath` and `VpnGateway`. Defaults to `ExpressRoute`.
     */
    @JvmName("gkclmqiqigwwwkrj")
    public suspend fun hubRoutingPreference(`value`: Output) {
        this.hubRoutingPreference = value
    }

    /**
     * @param value Specifies the supported Azure location where the Virtual Hub should exist. Changing this forces a new resource to be created.
     */
    @JvmName("kxjrulucqnjmdjvd")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

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

    /**
     * @param value Specifies the name of the Resource Group where the Virtual Hub should exist. Changing this forces a new resource to be created.
     */
    @JvmName("ipnaveilsrcatptn")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value One or more `route` blocks as defined below.
     */
    @JvmName("iedeherorpfirfxe")
    public suspend fun routes(`value`: Output>) {
        this.routes = value
    }

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

    /**
     * @param values One or more `route` blocks as defined below.
     */
    @JvmName("xqwtmervyyakbdfg")
    public suspend fun routes(values: List>) {
        this.routes = Output.all(values)
    }

    /**
     * @param value The SKU of the Virtual Hub. Possible values are `Basic` and `Standard`. Changing this forces a new resource to be created.
     */
    @JvmName("ryjtqdgsjvjpjjqo")
    public suspend fun sku(`value`: Output) {
        this.sku = value
    }

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

    /**
     * @param value Minimum instance capacity for the scaling configuration of the Virtual Hub Router.
     */
    @JvmName("kdgmfidkahbymdsa")
    public suspend fun virtualRouterAutoScaleMinCapacity(`value`: Output) {
        this.virtualRouterAutoScaleMinCapacity = value
    }

    /**
     * @param value The ID of a Virtual WAN within which the Virtual Hub should be created. Changing this forces a new resource to be created.
     */
    @JvmName("mqhomvqnutnhqlyk")
    public suspend fun virtualWanId(`value`: Output) {
        this.virtualWanId = value
    }

    /**
     * @param value The Address Prefix which should be used for this Virtual Hub. Changing this forces a new resource to be created. [The address prefix subnet cannot be smaller than a `/24`. Azure recommends using a `/23`](https://docs.microsoft.com/azure/virtual-wan/virtual-wan-faq#what-is-the-recommended-hub-address-space-during-hub-creation).
     */
    @JvmName("viwoibnnmmxwetdr")
    public suspend fun addressPrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.addressPrefix = mapped
    }

    /**
     * @param value The hub routing preference. Possible values are `ExpressRoute`, `ASPath` and `VpnGateway`. Defaults to `ExpressRoute`.
     */
    @JvmName("johyrrbnnmdomepg")
    public suspend fun hubRoutingPreference(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hubRoutingPreference = mapped
    }

    /**
     * @param value Specifies the supported Azure location where the Virtual Hub should exist. Changing this forces a new resource to be created.
     */
    @JvmName("bhywyslewycbkpnq")
    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 Hub. Changing this forces a new resource to be created.
     */
    @JvmName("hitucafhcwjqbocu")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Specifies the name of the Resource Group where the Virtual Hub should exist. Changing this forces a new resource to be created.
     */
    @JvmName("tmnemyvpqttwcpag")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value One or more `route` blocks as defined below.
     */
    @JvmName("hvllsrkgqtibclkn")
    public suspend fun routes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.routes = mapped
    }

    /**
     * @param argument One or more `route` blocks as defined below.
     */
    @JvmName("glpmrrqovknhiujy")
    public suspend fun routes(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            VirtualHubRouteArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.routes = mapped
    }

    /**
     * @param argument One or more `route` blocks as defined below.
     */
    @JvmName("orjqmwhedokqpjhj")
    public suspend fun routes(vararg argument: suspend VirtualHubRouteArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            VirtualHubRouteArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.routes = mapped
    }

    /**
     * @param argument One or more `route` blocks as defined below.
     */
    @JvmName("ceradqnxmqlouopg")
    public suspend fun routes(argument: suspend VirtualHubRouteArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(VirtualHubRouteArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.routes = mapped
    }

    /**
     * @param values One or more `route` blocks as defined below.
     */
    @JvmName("vlylernyktcyabou")
    public suspend fun routes(vararg values: VirtualHubRouteArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.routes = mapped
    }

    /**
     * @param value The SKU of the Virtual Hub. Possible values are `Basic` and `Standard`. Changing this forces a new resource to be created.
     */
    @JvmName("heniksgetlltjeqf")
    public suspend fun sku(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sku = mapped
    }

    /**
     * @param value A mapping of tags to assign to the Virtual Hub.
     */
    @JvmName("tpcabamoamthpjqn")
    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 Virtual Hub.
     */
    @JvmName("hrhhdaosawthpbqc")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value Minimum instance capacity for the scaling configuration of the Virtual Hub Router.
     */
    @JvmName("ebgtgrqdxswhjhtu")
    public suspend fun virtualRouterAutoScaleMinCapacity(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.virtualRouterAutoScaleMinCapacity = mapped
    }

    /**
     * @param value The ID of a Virtual WAN within which the Virtual Hub should be created. Changing this forces a new resource to be created.
     */
    @JvmName("iapjlbpinluvimos")
    public suspend fun virtualWanId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.virtualWanId = mapped
    }

    internal fun build(): VirtualHubArgs = VirtualHubArgs(
        addressPrefix = addressPrefix,
        hubRoutingPreference = hubRoutingPreference,
        location = location,
        name = name,
        resourceGroupName = resourceGroupName,
        routes = routes,
        sku = sku,
        tags = tags,
        virtualRouterAutoScaleMinCapacity = virtualRouterAutoScaleMinCapacity,
        virtualWanId = virtualWanId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy