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

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

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

package com.pulumi.azurenative.network.kotlin

import com.pulumi.azurenative.network.RoutingIntentArgs.builder
import com.pulumi.azurenative.network.kotlin.inputs.RoutingPolicyArgs
import com.pulumi.azurenative.network.kotlin.inputs.RoutingPolicyArgsBuilder
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * The routing intent child resource of a Virtual hub.
 * Azure REST API version: 2023-02-01. Prior API version in Azure Native 1.x: 2022-01-01.
 * Other available API versions: 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01.
 * ## Example Usage
 * ### RouteTablePut
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var routingIntent = new AzureNative.Network.RoutingIntent("routingIntent", new()
 *     {
 *         ResourceGroupName = "rg1",
 *         RoutingIntentName = "Intent1",
 *         RoutingPolicies = new[]
 *         {
 *             new AzureNative.Network.Inputs.RoutingPolicyArgs
 *             {
 *                 Destinations = new[]
 *                 {
 *                     "Internet",
 *                 },
 *                 Name = "InternetTraffic",
 *                 NextHop = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1",
 *             },
 *             new AzureNative.Network.Inputs.RoutingPolicyArgs
 *             {
 *                 Destinations = new[]
 *                 {
 *                     "PrivateTraffic",
 *                 },
 *                 Name = "PrivateTrafficPolicy",
 *                 NextHop = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1",
 *             },
 *         },
 *         VirtualHubName = "virtualHub1",
 *     });
 * });
 * ```
 * ```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.NewRoutingIntent(ctx, "routingIntent", &network.RoutingIntentArgs{
 * 			ResourceGroupName: pulumi.String("rg1"),
 * 			RoutingIntentName: pulumi.String("Intent1"),
 * 			RoutingPolicies: network.RoutingPolicyArray{
 * 				&network.RoutingPolicyArgs{
 * 					Destinations: pulumi.StringArray{
 * 						pulumi.String("Internet"),
 * 					},
 * 					Name:    pulumi.String("InternetTraffic"),
 * 					NextHop: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"),
 * 				},
 * 				&network.RoutingPolicyArgs{
 * 					Destinations: pulumi.StringArray{
 * 						pulumi.String("PrivateTraffic"),
 * 					},
 * 					Name:    pulumi.String("PrivateTrafficPolicy"),
 * 					NextHop: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"),
 * 				},
 * 			},
 * 			VirtualHubName: pulumi.String("virtualHub1"),
 * 		})
 * 		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.RoutingIntent;
 * import com.pulumi.azurenative.network.RoutingIntentArgs;
 * import com.pulumi.azurenative.network.inputs.RoutingPolicyArgs;
 * 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 routingIntent = new RoutingIntent("routingIntent", RoutingIntentArgs.builder()
 *             .resourceGroupName("rg1")
 *             .routingIntentName("Intent1")
 *             .routingPolicies(
 *                 RoutingPolicyArgs.builder()
 *                     .destinations("Internet")
 *                     .name("InternetTraffic")
 *                     .nextHop("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1")
 *                     .build(),
 *                 RoutingPolicyArgs.builder()
 *                     .destinations("PrivateTraffic")
 *                     .name("PrivateTrafficPolicy")
 *                     .nextHop("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1")
 *                     .build())
 *             .virtualHubName("virtualHub1")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:network:RoutingIntent Intent1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}
 * ```
 * @property id Resource ID.
 * @property name The name of the resource that is unique within a resource group. This name can be used to access the resource.
 * @property resourceGroupName The resource group name of the RoutingIntent.
 * @property routingIntentName The name of the per VirtualHub singleton Routing Intent resource.
 * @property routingPolicies List of routing policies.
 * @property virtualHubName The name of the VirtualHub.
 */
public data class RoutingIntentArgs(
    public val id: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val routingIntentName: Output? = null,
    public val routingPolicies: Output>? = null,
    public val virtualHubName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.network.RoutingIntentArgs =
        com.pulumi.azurenative.network.RoutingIntentArgs.builder()
            .id(id?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .routingIntentName(routingIntentName?.applyValue({ args0 -> args0 }))
            .routingPolicies(
                routingPolicies?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .virtualHubName(virtualHubName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [RoutingIntentArgs].
 */
@PulumiTagMarker
public class RoutingIntentArgsBuilder internal constructor() {
    private var id: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var routingIntentName: Output? = null

    private var routingPolicies: Output>? = null

    private var virtualHubName: Output? = null

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

    /**
     * @param value The name of the resource that is unique within a resource group. This name can be used to access the resource.
     */
    @JvmName("lrdmastlcvmxrerk")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

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

    /**
     * @param value The name of the per VirtualHub singleton Routing Intent resource.
     */
    @JvmName("rsjjidfheuvgshxf")
    public suspend fun routingIntentName(`value`: Output) {
        this.routingIntentName = value
    }

    /**
     * @param value List of routing policies.
     */
    @JvmName("mdlwnymdbrkiyshl")
    public suspend fun routingPolicies(`value`: Output>) {
        this.routingPolicies = value
    }

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

    /**
     * @param values List of routing policies.
     */
    @JvmName("uimldauhkrumlynk")
    public suspend fun routingPolicies(values: List>) {
        this.routingPolicies = Output.all(values)
    }

    /**
     * @param value The name of the VirtualHub.
     */
    @JvmName("nooqjmhhlusijocx")
    public suspend fun virtualHubName(`value`: Output) {
        this.virtualHubName = value
    }

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

    /**
     * @param value The name of the resource that is unique within a resource group. This name can be used to access the resource.
     */
    @JvmName("dnpeujaslitfupnq")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The resource group name of the RoutingIntent.
     */
    @JvmName("mebcnmvmtuyytrlh")
    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 per VirtualHub singleton Routing Intent resource.
     */
    @JvmName("rcyjwtdsqouyxcto")
    public suspend fun routingIntentName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.routingIntentName = mapped
    }

    /**
     * @param value List of routing policies.
     */
    @JvmName("txejatlljucrecnv")
    public suspend fun routingPolicies(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.routingPolicies = mapped
    }

    /**
     * @param argument List of routing policies.
     */
    @JvmName("kqltkawhenmoyjsh")
    public suspend fun routingPolicies(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            RoutingPolicyArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.routingPolicies = mapped
    }

    /**
     * @param argument List of routing policies.
     */
    @JvmName("mtnvpxydcuaiapvj")
    public suspend fun routingPolicies(vararg argument: suspend RoutingPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            RoutingPolicyArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.routingPolicies = mapped
    }

    /**
     * @param argument List of routing policies.
     */
    @JvmName("dsfjvohqulkmwcei")
    public suspend fun routingPolicies(argument: suspend RoutingPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(RoutingPolicyArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.routingPolicies = mapped
    }

    /**
     * @param values List of routing policies.
     */
    @JvmName("kqfcrhdikowirppx")
    public suspend fun routingPolicies(vararg values: RoutingPolicyArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.routingPolicies = mapped
    }

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

    internal fun build(): RoutingIntentArgs = RoutingIntentArgs(
        id = id,
        name = name,
        resourceGroupName = resourceGroupName,
        routingIntentName = routingIntentName,
        routingPolicies = routingPolicies,
        virtualHubName = virtualHubName,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy