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

com.pulumi.azure.network.kotlin.RoutingIntentArgs.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.21.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.network.kotlin

import com.pulumi.azure.network.RoutingIntentArgs.builder
import com.pulumi.azure.network.kotlin.inputs.RoutingIntentRoutingPolicyArgs
import com.pulumi.azure.network.kotlin.inputs.RoutingIntentRoutingPolicyArgsBuilder
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

/**
 * Manages a Virtual Hub Routing Intent.
 * ## 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-vwan",
 *     resourceGroupName: example.name,
 *     location: example.location,
 * });
 * const exampleVirtualHub = new azure.network.VirtualHub("example", {
 *     name: "example-vhub",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     virtualWanId: exampleVirtualWan.id,
 *     addressPrefix: "10.0.1.0/24",
 * });
 * const exampleFirewall = new azure.network.Firewall("example", {
 *     name: "example-fw",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     skuName: "AZFW_Hub",
 *     skuTier: "Standard",
 *     virtualHub: {
 *         virtualHubId: exampleVirtualHub.id,
 *         publicIpCount: 1,
 *     },
 * });
 * const exampleRoutingIntent = new azure.network.RoutingIntent("example", {
 *     name: "example-routingintent",
 *     virtualHubId: exampleVirtualHub.id,
 *     routingPolicies: [{
 *         name: "InternetTrafficPolicy",
 *         destinations: ["Internet"],
 *         nextHop: exampleFirewall.id,
 *     }],
 * });
 * ```
 * ```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-vwan",
 *     resource_group_name=example.name,
 *     location=example.location)
 * example_virtual_hub = azure.network.VirtualHub("example",
 *     name="example-vhub",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     virtual_wan_id=example_virtual_wan.id,
 *     address_prefix="10.0.1.0/24")
 * example_firewall = azure.network.Firewall("example",
 *     name="example-fw",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku_name="AZFW_Hub",
 *     sku_tier="Standard",
 *     virtual_hub=azure.network.FirewallVirtualHubArgs(
 *         virtual_hub_id=example_virtual_hub.id,
 *         public_ip_count=1,
 *     ))
 * example_routing_intent = azure.network.RoutingIntent("example",
 *     name="example-routingintent",
 *     virtual_hub_id=example_virtual_hub.id,
 *     routing_policies=[azure.network.RoutingIntentRoutingPolicyArgs(
 *         name="InternetTrafficPolicy",
 *         destinations=["Internet"],
 *         next_hop=example_firewall.id,
 *     )])
 * ```
 * ```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-vwan",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *     });
 *     var exampleVirtualHub = new Azure.Network.VirtualHub("example", new()
 *     {
 *         Name = "example-vhub",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         VirtualWanId = exampleVirtualWan.Id,
 *         AddressPrefix = "10.0.1.0/24",
 *     });
 *     var exampleFirewall = new Azure.Network.Firewall("example", new()
 *     {
 *         Name = "example-fw",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         SkuName = "AZFW_Hub",
 *         SkuTier = "Standard",
 *         VirtualHub = new Azure.Network.Inputs.FirewallVirtualHubArgs
 *         {
 *             VirtualHubId = exampleVirtualHub.Id,
 *             PublicIpCount = 1,
 *         },
 *     });
 *     var exampleRoutingIntent = new Azure.Network.RoutingIntent("example", new()
 *     {
 *         Name = "example-routingintent",
 *         VirtualHubId = exampleVirtualHub.Id,
 *         RoutingPolicies = new[]
 *         {
 *             new Azure.Network.Inputs.RoutingIntentRoutingPolicyArgs
 *             {
 *                 Name = "InternetTrafficPolicy",
 *                 Destinations = new[]
 *                 {
 *                     "Internet",
 *                 },
 *                 NextHop = exampleFirewall.Id,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```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-vwan"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleVirtualHub, err := network.NewVirtualHub(ctx, "example", &network.VirtualHubArgs{
 * 			Name:              pulumi.String("example-vhub"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			VirtualWanId:      exampleVirtualWan.ID(),
 * 			AddressPrefix:     pulumi.String("10.0.1.0/24"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleFirewall, err := network.NewFirewall(ctx, "example", &network.FirewallArgs{
 * 			Name:              pulumi.String("example-fw"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			SkuName:           pulumi.String("AZFW_Hub"),
 * 			SkuTier:           pulumi.String("Standard"),
 * 			VirtualHub: &network.FirewallVirtualHubArgs{
 * 				VirtualHubId:  exampleVirtualHub.ID(),
 * 				PublicIpCount: pulumi.Int(1),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewRoutingIntent(ctx, "example", &network.RoutingIntentArgs{
 * 			Name:         pulumi.String("example-routingintent"),
 * 			VirtualHubId: exampleVirtualHub.ID(),
 * 			RoutingPolicies: network.RoutingIntentRoutingPolicyArray{
 * 				&network.RoutingIntentRoutingPolicyArgs{
 * 					Name: pulumi.String("InternetTrafficPolicy"),
 * 					Destinations: pulumi.StringArray{
 * 						pulumi.String("Internet"),
 * 					},
 * 					NextHop: exampleFirewall.ID(),
 * 				},
 * 			},
 * 		})
 * 		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 com.pulumi.azure.network.Firewall;
 * import com.pulumi.azure.network.FirewallArgs;
 * import com.pulumi.azure.network.inputs.FirewallVirtualHubArgs;
 * import com.pulumi.azure.network.RoutingIntent;
 * import com.pulumi.azure.network.RoutingIntentArgs;
 * import com.pulumi.azure.network.inputs.RoutingIntentRoutingPolicyArgs;
 * 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-vwan")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .build());
 *         var exampleVirtualHub = new VirtualHub("exampleVirtualHub", VirtualHubArgs.builder()
 *             .name("example-vhub")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .virtualWanId(exampleVirtualWan.id())
 *             .addressPrefix("10.0.1.0/24")
 *             .build());
 *         var exampleFirewall = new Firewall("exampleFirewall", FirewallArgs.builder()
 *             .name("example-fw")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .skuName("AZFW_Hub")
 *             .skuTier("Standard")
 *             .virtualHub(FirewallVirtualHubArgs.builder()
 *                 .virtualHubId(exampleVirtualHub.id())
 *                 .publicIpCount(1)
 *                 .build())
 *             .build());
 *         var exampleRoutingIntent = new RoutingIntent("exampleRoutingIntent", RoutingIntentArgs.builder()
 *             .name("example-routingintent")
 *             .virtualHubId(exampleVirtualHub.id())
 *             .routingPolicies(RoutingIntentRoutingPolicyArgs.builder()
 *                 .name("InternetTrafficPolicy")
 *                 .destinations("Internet")
 *                 .nextHop(exampleFirewall.id())
 *                 .build())
 *             .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-vwan
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *   exampleVirtualHub:
 *     type: azure:network:VirtualHub
 *     name: example
 *     properties:
 *       name: example-vhub
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       virtualWanId: ${exampleVirtualWan.id}
 *       addressPrefix: 10.0.1.0/24
 *   exampleFirewall:
 *     type: azure:network:Firewall
 *     name: example
 *     properties:
 *       name: example-fw
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       skuName: AZFW_Hub
 *       skuTier: Standard
 *       virtualHub:
 *         virtualHubId: ${exampleVirtualHub.id}
 *         publicIpCount: 1
 *   exampleRoutingIntent:
 *     type: azure:network:RoutingIntent
 *     name: example
 *     properties:
 *       name: example-routingintent
 *       virtualHubId: ${exampleVirtualHub.id}
 *       routingPolicies:
 *         - name: InternetTrafficPolicy
 *           destinations:
 *             - Internet
 *           nextHop: ${exampleFirewall.id}
 * ```
 * 
 * ## Import
 * Virtual Hub Routing Intents can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/routingIntent:RoutingIntent example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Network/virtualHubs/virtualHub1/routingIntent/routingIntent1
 * ```
 * @property name The name which should be used for this Virtual Hub Routing Intent. Changing this forces a new resource to be created.
 * @property routingPolicies One or more `routing_policy` blocks as defined below.
 * @property virtualHubId The resource ID of the Virtual Hub. Changing this forces a new resource to be created.
 */
public data class RoutingIntentArgs(
    public val name: Output? = null,
    public val routingPolicies: Output>? = null,
    public val virtualHubId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.network.RoutingIntentArgs =
        com.pulumi.azure.network.RoutingIntentArgs.builder()
            .name(name?.applyValue({ args0 -> args0 }))
            .routingPolicies(
                routingPolicies?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .virtualHubId(virtualHubId?.applyValue({ args0 -> args0 })).build()
}

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

    private var routingPolicies: Output>? = null

    private var virtualHubId: Output? = null

    /**
     * @param value The name which should be used for this Virtual Hub Routing Intent. Changing this forces a new resource to be created.
     */
    @JvmName("invwkiyanmkfikmy")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

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

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

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

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

    /**
     * @param value The name which should be used for this Virtual Hub Routing Intent. Changing this forces a new resource to be created.
     */
    @JvmName("wrgmlrbndcjtcfpg")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

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

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

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

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

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

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

    internal fun build(): RoutingIntentArgs = RoutingIntentArgs(
        name = name,
        routingPolicies = routingPolicies,
        virtualHubId = virtualHubId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy