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

com.pulumi.azurenative.network.kotlin.RouteTableArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.network.kotlin

import com.pulumi.azurenative.network.RouteTableArgs.builder
import com.pulumi.azurenative.network.kotlin.inputs.RouteArgs
import com.pulumi.azurenative.network.kotlin.inputs.RouteArgsBuilder
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.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Route table resource.
 * Azure REST API version: 2023-02-01. Prior API version in Azure Native 1.x: 2020-11-01.
 * Other available API versions: 2015-05-01-preview, 2016-03-30, 2019-06-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01.
 * ## Example Usage
 * ### Create route table
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var routeTable = new AzureNative.Network.RouteTable("routeTable", new()
 *     {
 *         Location = "westus",
 *         ResourceGroupName = "rg1",
 *         RouteTableName = "testrt",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := network.NewRouteTable(ctx, "routeTable", &network.RouteTableArgs{
 * 			Location:          pulumi.String("westus"),
 * 			ResourceGroupName: pulumi.String("rg1"),
 * 			RouteTableName:    pulumi.String("testrt"),
 * 		})
 * 		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.network.RouteTable;
 * import com.pulumi.azurenative.network.RouteTableArgs;
 * 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 routeTable = new RouteTable("routeTable", RouteTableArgs.builder()
 *             .location("westus")
 *             .resourceGroupName("rg1")
 *             .routeTableName("testrt")
 *             .build());
 *     }
 * }
 * ```
 * ### Create route table with route
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var routeTable = new AzureNative.Network.RouteTable("routeTable", new()
 *     {
 *         DisableBgpRoutePropagation = true,
 *         Location = "westus",
 *         ResourceGroupName = "rg1",
 *         RouteTableName = "testrt",
 *         Routes = new[]
 *         {
 *             new AzureNative.Network.Inputs.RouteArgs
 *             {
 *                 AddressPrefix = "10.0.3.0/24",
 *                 Name = "route1",
 *                 NextHopType = AzureNative.Network.RouteNextHopType.VirtualNetworkGateway,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := network.NewRouteTable(ctx, "routeTable", &network.RouteTableArgs{
 * 			DisableBgpRoutePropagation: pulumi.Bool(true),
 * 			Location:                   pulumi.String("westus"),
 * 			ResourceGroupName:          pulumi.String("rg1"),
 * 			RouteTableName:             pulumi.String("testrt"),
 * 			Routes: network.RouteTypeArray{
 * 				&network.RouteTypeArgs{
 * 					AddressPrefix: pulumi.String("10.0.3.0/24"),
 * 					Name:          pulumi.String("route1"),
 * 					NextHopType:   pulumi.String(network.RouteNextHopTypeVirtualNetworkGateway),
 * 				},
 * 			},
 * 		})
 * 		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.network.RouteTable;
 * import com.pulumi.azurenative.network.RouteTableArgs;
 * import com.pulumi.azurenative.network.inputs.RouteArgs;
 * 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 routeTable = new RouteTable("routeTable", RouteTableArgs.builder()
 *             .disableBgpRoutePropagation(true)
 *             .location("westus")
 *             .resourceGroupName("rg1")
 *             .routeTableName("testrt")
 *             .routes(RouteArgs.builder()
 *                 .addressPrefix("10.0.3.0/24")
 *                 .name("route1")
 *                 .nextHopType("VirtualNetworkGateway")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:network:RouteTable testrt /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}
 * ```
 * @property disableBgpRoutePropagation Whether to disable the routes learned by BGP on that route table. True means disable.
 * @property id Resource ID.
 * @property location Resource location.
 * @property resourceGroupName The name of the resource group.
 * @property routeTableName The name of the route table.
 * @property routes Collection of routes contained within a route table.
 * These are also available as standalone resources. Do not mix inline and standalone resource as they will conflict with each other, leading to resources deletion.
 * @property tags Resource tags.
 */
public data class RouteTableArgs(
    public val disableBgpRoutePropagation: Output? = null,
    public val id: Output? = null,
    public val location: Output? = null,
    public val resourceGroupName: Output? = null,
    public val routeTableName: Output? = null,
    public val routes: Output>? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.network.RouteTableArgs =
        com.pulumi.azurenative.network.RouteTableArgs.builder()
            .disableBgpRoutePropagation(disableBgpRoutePropagation?.applyValue({ args0 -> args0 }))
            .id(id?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .routeTableName(routeTableName?.applyValue({ args0 -> args0 }))
            .routes(routes?.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 [RouteTableArgs].
 */
@PulumiTagMarker
public class RouteTableArgsBuilder internal constructor() {
    private var disableBgpRoutePropagation: Output? = null

    private var id: Output? = null

    private var location: Output? = null

    private var resourceGroupName: Output? = null

    private var routeTableName: Output? = null

    private var routes: Output>? = null

    private var tags: Output>? = null

    /**
     * @param value Whether to disable the routes learned by BGP on that route table. True means disable.
     */
    @JvmName("nxbsgrfdmpqdkpyv")
    public suspend fun disableBgpRoutePropagation(`value`: Output) {
        this.disableBgpRoutePropagation = value
    }

    /**
     * @param value Resource ID.
     */
    @JvmName("edluhalscthfmvxw")
    public suspend fun id(`value`: Output) {
        this.id = value
    }

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

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

    /**
     * @param value The name of the route table.
     */
    @JvmName("blkgqmfabpgomidh")
    public suspend fun routeTableName(`value`: Output) {
        this.routeTableName = value
    }

    /**
     * @param value Collection of routes contained within a route table.
     * These are also available as standalone resources. Do not mix inline and standalone resource as they will conflict with each other, leading to resources deletion.
     */
    @JvmName("xtnwyclnafixbhvr")
    public suspend fun routes(`value`: Output>) {
        this.routes = value
    }

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

    /**
     * @param values Collection of routes contained within a route table.
     * These are also available as standalone resources. Do not mix inline and standalone resource as they will conflict with each other, leading to resources deletion.
     */
    @JvmName("uwnwypvwqaradwxj")
    public suspend fun routes(values: List>) {
        this.routes = Output.all(values)
    }

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

    /**
     * @param value Whether to disable the routes learned by BGP on that route table. True means disable.
     */
    @JvmName("qcdvegtxqxgmwxhr")
    public suspend fun disableBgpRoutePropagation(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disableBgpRoutePropagation = mapped
    }

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

    /**
     * @param value Resource location.
     */
    @JvmName("jyycocchmhtwrryq")
    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 resource group.
     */
    @JvmName("ucedmckvrfwdpfkv")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The name of the route table.
     */
    @JvmName("ccbdaunbshtfmcmh")
    public suspend fun routeTableName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.routeTableName = mapped
    }

    /**
     * @param value Collection of routes contained within a route table.
     * These are also available as standalone resources. Do not mix inline and standalone resource as they will conflict with each other, leading to resources deletion.
     */
    @JvmName("aafkknpasterwmco")
    public suspend fun routes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.routes = mapped
    }

    /**
     * @param argument Collection of routes contained within a route table.
     * These are also available as standalone resources. Do not mix inline and standalone resource as they will conflict with each other, leading to resources deletion.
     */
    @JvmName("elbhnfpxoucxkpon")
    public suspend fun routes(argument: List Unit>) {
        val toBeMapped = argument.toList().map { RouteArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.routes = mapped
    }

    /**
     * @param argument Collection of routes contained within a route table.
     * These are also available as standalone resources. Do not mix inline and standalone resource as they will conflict with each other, leading to resources deletion.
     */
    @JvmName("wkdbseqqlwchdspm")
    public suspend fun routes(vararg argument: suspend RouteArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { RouteArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.routes = mapped
    }

    /**
     * @param argument Collection of routes contained within a route table.
     * These are also available as standalone resources. Do not mix inline and standalone resource as they will conflict with each other, leading to resources deletion.
     */
    @JvmName("ieynndjcresearlh")
    public suspend fun routes(argument: suspend RouteArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(RouteArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.routes = mapped
    }

    /**
     * @param values Collection of routes contained within a route table.
     * These are also available as standalone resources. Do not mix inline and standalone resource as they will conflict with each other, leading to resources deletion.
     */
    @JvmName("nmhiltobwktodvpu")
    public suspend fun routes(vararg values: RouteArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.routes = mapped
    }

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

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

    internal fun build(): RouteTableArgs = RouteTableArgs(
        disableBgpRoutePropagation = disableBgpRoutePropagation,
        id = id,
        location = location,
        resourceGroupName = resourceGroupName,
        routeTableName = routeTableName,
        routes = routes,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy