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

com.pulumi.azure.network.kotlin.RouteArgs.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.RouteArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages a Route within a Route Table.
 * > **NOTE on Route Tables and Routes:** This provider currently
 * provides both a standalone Route resource, and allows for Routes to be defined in-line within the Route Table resource.
 * At this time you cannot use a Route Table with in-line Routes in conjunction with any Route resources. Doing so will cause a conflict of Route configurations and will overwrite Routes.
 * ## 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 exampleRouteTable = new azure.network.RouteTable("example", {
 *     name: "acceptanceTestRouteTable1",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleRoute = new azure.network.Route("example", {
 *     name: "acceptanceTestRoute1",
 *     resourceGroupName: example.name,
 *     routeTableName: exampleRouteTable.name,
 *     addressPrefix: "10.1.0.0/16",
 *     nextHopType: "VnetLocal",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_route_table = azure.network.RouteTable("example",
 *     name="acceptanceTestRouteTable1",
 *     location=example.location,
 *     resource_group_name=example.name)
 * example_route = azure.network.Route("example",
 *     name="acceptanceTestRoute1",
 *     resource_group_name=example.name,
 *     route_table_name=example_route_table.name,
 *     address_prefix="10.1.0.0/16",
 *     next_hop_type="VnetLocal")
 * ```
 * ```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 exampleRouteTable = new Azure.Network.RouteTable("example", new()
 *     {
 *         Name = "acceptanceTestRouteTable1",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *     });
 *     var exampleRoute = new Azure.Network.Route("example", new()
 *     {
 *         Name = "acceptanceTestRoute1",
 *         ResourceGroupName = example.Name,
 *         RouteTableName = exampleRouteTable.Name,
 *         AddressPrefix = "10.1.0.0/16",
 *         NextHopType = "VnetLocal",
 *     });
 * });
 * ```
 * ```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
 * 		}
 * 		exampleRouteTable, err := network.NewRouteTable(ctx, "example", &network.RouteTableArgs{
 * 			Name:              pulumi.String("acceptanceTestRouteTable1"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewRoute(ctx, "example", &network.RouteArgs{
 * 			Name:              pulumi.String("acceptanceTestRoute1"),
 * 			ResourceGroupName: example.Name,
 * 			RouteTableName:    exampleRouteTable.Name,
 * 			AddressPrefix:     pulumi.String("10.1.0.0/16"),
 * 			NextHopType:       pulumi.String("VnetLocal"),
 * 		})
 * 		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.RouteTable;
 * import com.pulumi.azure.network.RouteTableArgs;
 * import com.pulumi.azure.network.Route;
 * import com.pulumi.azure.network.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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleRouteTable = new RouteTable("exampleRouteTable", RouteTableArgs.builder()
 *             .name("acceptanceTestRouteTable1")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 *         var exampleRoute = new Route("exampleRoute", RouteArgs.builder()
 *             .name("acceptanceTestRoute1")
 *             .resourceGroupName(example.name())
 *             .routeTableName(exampleRouteTable.name())
 *             .addressPrefix("10.1.0.0/16")
 *             .nextHopType("VnetLocal")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleRouteTable:
 *     type: azure:network:RouteTable
 *     name: example
 *     properties:
 *       name: acceptanceTestRouteTable1
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *   exampleRoute:
 *     type: azure:network:Route
 *     name: example
 *     properties:
 *       name: acceptanceTestRoute1
 *       resourceGroupName: ${example.name}
 *       routeTableName: ${exampleRouteTable.name}
 *       addressPrefix: 10.1.0.0/16
 *       nextHopType: VnetLocal
 * ```
 * 
 * ## Import
 * Routes can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/route:Route exampleRoute /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/routeTables/mytable1/routes/myroute1
 * ```
 * @property addressPrefix The destination to which the route applies. Can be CIDR (such as `10.1.0.0/16`) or [Azure Service Tag](https://docs.microsoft.com/azure/virtual-network/service-tags-overview) (such as `ApiManagement`, `AzureBackup` or `AzureMonitor`) format.
 * @property name The name of the route. Changing this forces a new resource to be created.
 * @property nextHopInIpAddress Contains the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is `VirtualAppliance`.
 * @property nextHopType The type of Azure hop the packet should be sent to. Possible values are `VirtualNetworkGateway`, `VnetLocal`, `Internet`, `VirtualAppliance` and `None`.
 * @property resourceGroupName The name of the resource group in which to create the route. Changing this forces a new resource to be created.
 * @property routeTableName The name of the route table within which create the route. Changing this forces a new resource to be created.
 */
public data class RouteArgs(
    public val addressPrefix: Output? = null,
    public val name: Output? = null,
    public val nextHopInIpAddress: Output? = null,
    public val nextHopType: Output? = null,
    public val resourceGroupName: Output? = null,
    public val routeTableName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.network.RouteArgs =
        com.pulumi.azure.network.RouteArgs.builder()
            .addressPrefix(addressPrefix?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .nextHopInIpAddress(nextHopInIpAddress?.applyValue({ args0 -> args0 }))
            .nextHopType(nextHopType?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .routeTableName(routeTableName?.applyValue({ args0 -> args0 })).build()
}

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

    private var name: Output? = null

    private var nextHopInIpAddress: Output? = null

    private var nextHopType: Output? = null

    private var resourceGroupName: Output? = null

    private var routeTableName: Output? = null

    /**
     * @param value The destination to which the route applies. Can be CIDR (such as `10.1.0.0/16`) or [Azure Service Tag](https://docs.microsoft.com/azure/virtual-network/service-tags-overview) (such as `ApiManagement`, `AzureBackup` or `AzureMonitor`) format.
     */
    @JvmName("dhtghbbysrpglftd")
    public suspend fun addressPrefix(`value`: Output) {
        this.addressPrefix = value
    }

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

    /**
     * @param value Contains the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is `VirtualAppliance`.
     */
    @JvmName("xcfelujbcjhhxikw")
    public suspend fun nextHopInIpAddress(`value`: Output) {
        this.nextHopInIpAddress = value
    }

    /**
     * @param value The type of Azure hop the packet should be sent to. Possible values are `VirtualNetworkGateway`, `VnetLocal`, `Internet`, `VirtualAppliance` and `None`.
     */
    @JvmName("qvdkoqdmuiugtoec")
    public suspend fun nextHopType(`value`: Output) {
        this.nextHopType = value
    }

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

    /**
     * @param value The name of the route table within which create the route. Changing this forces a new resource to be created.
     */
    @JvmName("awxofehjjrutxruu")
    public suspend fun routeTableName(`value`: Output) {
        this.routeTableName = value
    }

    /**
     * @param value The destination to which the route applies. Can be CIDR (such as `10.1.0.0/16`) or [Azure Service Tag](https://docs.microsoft.com/azure/virtual-network/service-tags-overview) (such as `ApiManagement`, `AzureBackup` or `AzureMonitor`) format.
     */
    @JvmName("hqcejvchrvxfooaj")
    public suspend fun addressPrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.addressPrefix = mapped
    }

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

    /**
     * @param value Contains the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is `VirtualAppliance`.
     */
    @JvmName("xkoyvrxuolkcdarr")
    public suspend fun nextHopInIpAddress(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.nextHopInIpAddress = mapped
    }

    /**
     * @param value The type of Azure hop the packet should be sent to. Possible values are `VirtualNetworkGateway`, `VnetLocal`, `Internet`, `VirtualAppliance` and `None`.
     */
    @JvmName("udhcmiygvgjuxcwv")
    public suspend fun nextHopType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.nextHopType = mapped
    }

    /**
     * @param value The name of the resource group in which to create the route. Changing this forces a new resource to be created.
     */
    @JvmName("tnvoyibxxkwjfvle")
    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 within which create the route. Changing this forces a new resource to be created.
     */
    @JvmName("qautpqhjdqfgtblr")
    public suspend fun routeTableName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.routeTableName = mapped
    }

    internal fun build(): RouteArgs = RouteArgs(
        addressPrefix = addressPrefix,
        name = name,
        nextHopInIpAddress = nextHopInIpAddress,
        nextHopType = nextHopType,
        resourceGroupName = resourceGroupName,
        routeTableName = routeTableName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy