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

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

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

package com.pulumi.azure.lb.kotlin

import com.pulumi.azure.lb.BackendAddressPoolArgs.builder
import com.pulumi.azure.lb.kotlin.inputs.BackendAddressPoolTunnelInterfaceArgs
import com.pulumi.azure.lb.kotlin.inputs.BackendAddressPoolTunnelInterfaceArgsBuilder
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 Load Balancer Backend Address Pool.
 * > **NOTE:** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached
 * ## 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,
 *     }],
 * });
 * const exampleBackendAddressPool = new azure.lb.BackendAddressPool("example", {
 *     loadbalancerId: exampleLoadBalancer.id,
 *     name: "BackEndAddressPool",
 * });
 * ```
 * ```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,
 *     }])
 * example_backend_address_pool = azure.lb.BackendAddressPool("example",
 *     loadbalancer_id=example_load_balancer.id,
 *     name="BackEndAddressPool")
 * ```
 * ```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,
 *             },
 *         },
 *     });
 *     var exampleBackendAddressPool = new Azure.Lb.BackendAddressPool("example", new()
 *     {
 *         LoadbalancerId = exampleLoadBalancer.Id,
 *         Name = "BackEndAddressPool",
 *     });
 * });
 * ```
 * ```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
 * 		}
 * 		exampleLoadBalancer, 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
 * 		}
 * 		_, err = lb.NewBackendAddressPool(ctx, "example", &lb.BackendAddressPoolArgs{
 * 			LoadbalancerId: exampleLoadBalancer.ID(),
 * 			Name:           pulumi.String("BackEndAddressPool"),
 * 		})
 * 		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 com.pulumi.azure.lb.BackendAddressPool;
 * import com.pulumi.azure.lb.BackendAddressPoolArgs;
 * 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());
 *         var exampleBackendAddressPool = new BackendAddressPool("exampleBackendAddressPool", BackendAddressPoolArgs.builder()
 *             .loadbalancerId(exampleLoadBalancer.id())
 *             .name("BackEndAddressPool")
 *             .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}
 *   exampleBackendAddressPool:
 *     type: azure:lb:BackendAddressPool
 *     name: example
 *     properties:
 *       loadbalancerId: ${exampleLoadBalancer.id}
 *       name: BackEndAddressPool
 * ```
 * 
 * ## Import
 * Load Balancer Backend Address Pools can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:lb/backendAddressPool:BackendAddressPool example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/pool1
 * ```
 * @property loadbalancerId The ID of the Load Balancer in which to create the Backend Address Pool. Changing this forces a new resource to be created.
 * @property name Specifies the name of the Backend Address Pool. Changing this forces a new resource to be created.
 * @property synchronousMode The backend address synchronous mode for the Backend Address Pool. Possible values are `Automatic` and `Manual`. This is required with `virtual_network_id`. Changing this forces a new resource to be created.
 * > **NOTE:** The `synchronous_mode` can set only for Load Balancer with `Standard` SKU.
 * @property tunnelInterfaces One or more `tunnel_interface` blocks as defined below.
 * @property virtualNetworkId The ID of the Virtual Network within which the Backend Address Pool should exist.
 */
public data class BackendAddressPoolArgs(
    public val loadbalancerId: Output? = null,
    public val name: Output? = null,
    public val synchronousMode: Output? = null,
    public val tunnelInterfaces: Output>? = null,
    public val virtualNetworkId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.lb.BackendAddressPoolArgs =
        com.pulumi.azure.lb.BackendAddressPoolArgs.builder()
            .loadbalancerId(loadbalancerId?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .synchronousMode(synchronousMode?.applyValue({ args0 -> args0 }))
            .tunnelInterfaces(
                tunnelInterfaces?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .virtualNetworkId(virtualNetworkId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [BackendAddressPoolArgs].
 */
@PulumiTagMarker
public class BackendAddressPoolArgsBuilder internal constructor() {
    private var loadbalancerId: Output? = null

    private var name: Output? = null

    private var synchronousMode: Output? = null

    private var tunnelInterfaces: Output>? = null

    private var virtualNetworkId: Output? = null

    /**
     * @param value The ID of the Load Balancer in which to create the Backend Address Pool. Changing this forces a new resource to be created.
     */
    @JvmName("wvnkdnuxsrtsmhch")
    public suspend fun loadbalancerId(`value`: Output) {
        this.loadbalancerId = value
    }

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

    /**
     * @param value The backend address synchronous mode for the Backend Address Pool. Possible values are `Automatic` and `Manual`. This is required with `virtual_network_id`. Changing this forces a new resource to be created.
     * > **NOTE:** The `synchronous_mode` can set only for Load Balancer with `Standard` SKU.
     */
    @JvmName("qlfxkgtvtrkfcnny")
    public suspend fun synchronousMode(`value`: Output) {
        this.synchronousMode = value
    }

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

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

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

    /**
     * @param value The ID of the Virtual Network within which the Backend Address Pool should exist.
     */
    @JvmName("jssjpkakbvtvlvpq")
    public suspend fun virtualNetworkId(`value`: Output) {
        this.virtualNetworkId = value
    }

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

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

    /**
     * @param value The backend address synchronous mode for the Backend Address Pool. Possible values are `Automatic` and `Manual`. This is required with `virtual_network_id`. Changing this forces a new resource to be created.
     * > **NOTE:** The `synchronous_mode` can set only for Load Balancer with `Standard` SKU.
     */
    @JvmName("wmepaqxbjpdlfyfi")
    public suspend fun synchronousMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.synchronousMode = mapped
    }

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

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

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

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

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

    /**
     * @param value The ID of the Virtual Network within which the Backend Address Pool should exist.
     */
    @JvmName("agnwajijcwyeipjq")
    public suspend fun virtualNetworkId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.virtualNetworkId = mapped
    }

    internal fun build(): BackendAddressPoolArgs = BackendAddressPoolArgs(
        loadbalancerId = loadbalancerId,
        name = name,
        synchronousMode = synchronousMode,
        tunnelInterfaces = tunnelInterfaces,
        virtualNetworkId = virtualNetworkId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy