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

com.pulumi.azure.lb.kotlin.LoadBalancerArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.lb.kotlin

import com.pulumi.azure.lb.LoadBalancerArgs.builder
import com.pulumi.azure.lb.kotlin.inputs.LoadBalancerFrontendIpConfigurationArgs
import com.pulumi.azure.lb.kotlin.inputs.LoadBalancerFrontendIpConfigurationArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a Load Balancer Resource.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "LoadBalancerRG",
 *     location: "West Europe",
 * });
 * const examplePublicIp = new azure.network.PublicIp("example", {
 *     name: "PublicIPForLB",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     allocationMethod: "Static",
 * });
 * const exampleLoadBalancer = new azure.lb.LoadBalancer("example", {
 *     name: "TestLoadBalancer",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     frontendIpConfigurations: [{
 *         name: "PublicIPAddress",
 *         publicIpAddressId: examplePublicIp.id,
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="LoadBalancerRG",
 *     location="West Europe")
 * example_public_ip = azure.network.PublicIp("example",
 *     name="PublicIPForLB",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     allocation_method="Static")
 * example_load_balancer = azure.lb.LoadBalancer("example",
 *     name="TestLoadBalancer",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     frontend_ip_configurations=[{
 *         "name": "PublicIPAddress",
 *         "public_ip_address_id": example_public_ip.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 = "LoadBalancerRG",
 *         Location = "West Europe",
 *     });
 *     var examplePublicIp = new Azure.Network.PublicIp("example", new()
 *     {
 *         Name = "PublicIPForLB",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         AllocationMethod = "Static",
 *     });
 *     var exampleLoadBalancer = new Azure.Lb.LoadBalancer("example", new()
 *     {
 *         Name = "TestLoadBalancer",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         FrontendIpConfigurations = new[]
 *         {
 *             new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs
 *             {
 *                 Name = "PublicIPAddress",
 *                 PublicIpAddressId = examplePublicIp.Id,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb"
 * 	"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("LoadBalancerRG"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		examplePublicIp, err := network.NewPublicIp(ctx, "example", &network.PublicIpArgs{
 * 			Name:              pulumi.String("PublicIPForLB"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			AllocationMethod:  pulumi.String("Static"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = lb.NewLoadBalancer(ctx, "example", &lb.LoadBalancerArgs{
 * 			Name:              pulumi.String("TestLoadBalancer"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{
 * 				&lb.LoadBalancerFrontendIpConfigurationArgs{
 * 					Name:              pulumi.String("PublicIPAddress"),
 * 					PublicIpAddressId: examplePublicIp.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.PublicIp;
 * import com.pulumi.azure.network.PublicIpArgs;
 * import com.pulumi.azure.lb.LoadBalancer;
 * import com.pulumi.azure.lb.LoadBalancerArgs;
 * import com.pulumi.azure.lb.inputs.LoadBalancerFrontendIpConfigurationArgs;
 * 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("LoadBalancerRG")
 *             .location("West Europe")
 *             .build());
 *         var examplePublicIp = new PublicIp("examplePublicIp", PublicIpArgs.builder()
 *             .name("PublicIPForLB")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .allocationMethod("Static")
 *             .build());
 *         var exampleLoadBalancer = new LoadBalancer("exampleLoadBalancer", LoadBalancerArgs.builder()
 *             .name("TestLoadBalancer")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .frontendIpConfigurations(LoadBalancerFrontendIpConfigurationArgs.builder()
 *                 .name("PublicIPAddress")
 *                 .publicIpAddressId(examplePublicIp.id())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: LoadBalancerRG
 *       location: West Europe
 *   examplePublicIp:
 *     type: azure:network:PublicIp
 *     name: example
 *     properties:
 *       name: PublicIPForLB
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       allocationMethod: Static
 *   exampleLoadBalancer:
 *     type: azure:lb:LoadBalancer
 *     name: example
 *     properties:
 *       name: TestLoadBalancer
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       frontendIpConfigurations:
 *         - name: PublicIPAddress
 *           publicIpAddressId: ${examplePublicIp.id}
 * ```
 * 
 * ## Import
 * Load Balancers can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:lb/loadBalancer:LoadBalancer example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/loadBalancers/lb1
 * ```
 * @property edgeZone Specifies the Edge Zone within the Azure Region where this Load Balancer should exist. Changing this forces a new Load Balancer to be created.
 * @property frontendIpConfigurations One or more `frontend_ip_configuration` blocks as documented below.
 * @property location Specifies the supported Azure Region where the Load Balancer should be created. Changing this forces a new resource to be created.
 * @property name Specifies the name of the Load Balancer. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the Resource Group in which to create the Load Balancer. Changing this forces a new resource to be created.
 * @property sku The SKU of the Azure Load Balancer. Accepted values are `Basic`, `Standard` and `Gateway`. Defaults to `Basic`. Changing this forces a new resource to be created.
 * > **NOTE:** The `Microsoft.Network/AllowGatewayLoadBalancer` feature is required to be registered in order to use the `Gateway` SKU. The feature can only be registered by the Azure service team, please submit an [Azure support ticket](https://azure.microsoft.com/en-us/support/create-ticket/) for that.
 * @property skuTier `sku_tier` - (Optional) The SKU tier of this Load Balancer. Possible values are `Global` and `Regional`. Defaults to `Regional`. Changing this forces a new resource to be created.
 * @property tags A mapping of tags to assign to the resource.
 */
public data class LoadBalancerArgs(
    public val edgeZone: Output? = null,
    public val frontendIpConfigurations: Output>? =
        null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val sku: Output? = null,
    public val skuTier: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.lb.LoadBalancerArgs =
        com.pulumi.azure.lb.LoadBalancerArgs.builder()
            .edgeZone(edgeZone?.applyValue({ args0 -> args0 }))
            .frontendIpConfigurations(
                frontendIpConfigurations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .sku(sku?.applyValue({ args0 -> args0 }))
            .skuTier(skuTier?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [LoadBalancerArgs].
 */
@PulumiTagMarker
public class LoadBalancerArgsBuilder internal constructor() {
    private var edgeZone: Output? = null

    private var frontendIpConfigurations: Output>? =
        null

    private var location: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var sku: Output? = null

    private var skuTier: Output? = null

    private var tags: Output>? = null

    /**
     * @param value Specifies the Edge Zone within the Azure Region where this Load Balancer should exist. Changing this forces a new Load Balancer to be created.
     */
    @JvmName("dfjfvbofuykceyhh")
    public suspend fun edgeZone(`value`: Output) {
        this.edgeZone = value
    }

    /**
     * @param value One or more `frontend_ip_configuration` blocks as documented below.
     */
    @JvmName("cylxcatxkcdgiejv")
    public suspend fun frontendIpConfigurations(`value`: Output>) {
        this.frontendIpConfigurations = value
    }

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

    /**
     * @param values One or more `frontend_ip_configuration` blocks as documented below.
     */
    @JvmName("vxlhaqwegirouyja")
    public suspend fun frontendIpConfigurations(values: List>) {
        this.frontendIpConfigurations = Output.all(values)
    }

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

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

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

    /**
     * @param value The SKU of the Azure Load Balancer. Accepted values are `Basic`, `Standard` and `Gateway`. Defaults to `Basic`. Changing this forces a new resource to be created.
     * > **NOTE:** The `Microsoft.Network/AllowGatewayLoadBalancer` feature is required to be registered in order to use the `Gateway` SKU. The feature can only be registered by the Azure service team, please submit an [Azure support ticket](https://azure.microsoft.com/en-us/support/create-ticket/) for that.
     */
    @JvmName("rkqigtnqqxmtripl")
    public suspend fun sku(`value`: Output) {
        this.sku = value
    }

    /**
     * @param value `sku_tier` - (Optional) The SKU tier of this Load Balancer. Possible values are `Global` and `Regional`. Defaults to `Regional`. Changing this forces a new resource to be created.
     */
    @JvmName("vlcgwttkrvnbojrk")
    public suspend fun skuTier(`value`: Output) {
        this.skuTier = value
    }

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

    /**
     * @param value Specifies the Edge Zone within the Azure Region where this Load Balancer should exist. Changing this forces a new Load Balancer to be created.
     */
    @JvmName("ifirksvcatfndirf")
    public suspend fun edgeZone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.edgeZone = mapped
    }

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

    /**
     * @param argument One or more `frontend_ip_configuration` blocks as documented below.
     */
    @JvmName("ggjvuusiuolbwjsl")
    public suspend fun frontendIpConfigurations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerFrontendIpConfigurationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.frontendIpConfigurations = mapped
    }

    /**
     * @param argument One or more `frontend_ip_configuration` blocks as documented below.
     */
    @JvmName("wimurbqgldpeckue")
    public suspend fun frontendIpConfigurations(vararg argument: suspend LoadBalancerFrontendIpConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerFrontendIpConfigurationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.frontendIpConfigurations = mapped
    }

    /**
     * @param argument One or more `frontend_ip_configuration` blocks as documented below.
     */
    @JvmName("yleyjvmnyyrdarph")
    public suspend fun frontendIpConfigurations(argument: suspend LoadBalancerFrontendIpConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            LoadBalancerFrontendIpConfigurationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.frontendIpConfigurations = mapped
    }

    /**
     * @param values One or more `frontend_ip_configuration` blocks as documented below.
     */
    @JvmName("vvxndxvodhgldwdr")
    public suspend fun frontendIpConfigurations(vararg values: LoadBalancerFrontendIpConfigurationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.frontendIpConfigurations = mapped
    }

    /**
     * @param value Specifies the supported Azure Region where the Load Balancer should be created. Changing this forces a new resource to be created.
     */
    @JvmName("yssbivbsuxnyhggw")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

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

    /**
     * @param value The name of the Resource Group in which to create the Load Balancer. Changing this forces a new resource to be created.
     */
    @JvmName("isoorgicftahqsrg")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The SKU of the Azure Load Balancer. Accepted values are `Basic`, `Standard` and `Gateway`. Defaults to `Basic`. Changing this forces a new resource to be created.
     * > **NOTE:** The `Microsoft.Network/AllowGatewayLoadBalancer` feature is required to be registered in order to use the `Gateway` SKU. The feature can only be registered by the Azure service team, please submit an [Azure support ticket](https://azure.microsoft.com/en-us/support/create-ticket/) for that.
     */
    @JvmName("yyrslqobcpubypfu")
    public suspend fun sku(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sku = mapped
    }

    /**
     * @param value `sku_tier` - (Optional) The SKU tier of this Load Balancer. Possible values are `Global` and `Regional`. Defaults to `Regional`. Changing this forces a new resource to be created.
     */
    @JvmName("pcdhluqnmahgpklk")
    public suspend fun skuTier(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.skuTier = mapped
    }

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

    internal fun build(): LoadBalancerArgs = LoadBalancerArgs(
        edgeZone = edgeZone,
        frontendIpConfigurations = frontendIpConfigurations,
        location = location,
        name = name,
        resourceGroupName = resourceGroupName,
        sku = sku,
        skuTier = skuTier,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy