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

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

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

package com.pulumi.azure.lb.kotlin

import com.pulumi.azure.lb.NatPoolArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages a Load Balancer NAT pool.
 * > **NOTE:** This resource cannot be used with with virtual machines, instead use the `azure.lb.NatRule` resource.
 * > **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 exampleNatPool = new azure.lb.NatPool("example", {
 *     resourceGroupName: example.name,
 *     loadbalancerId: exampleLoadBalancer.id,
 *     name: "SampleApplicationPool",
 *     protocol: "Tcp",
 *     frontendPortStart: 80,
 *     frontendPortEnd: 81,
 *     backendPort: 8080,
 *     frontendIpConfigurationName: "PublicIPAddress",
 * });
 * ```
 * ```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_nat_pool = azure.lb.NatPool("example",
 *     resource_group_name=example.name,
 *     loadbalancer_id=example_load_balancer.id,
 *     name="SampleApplicationPool",
 *     protocol="Tcp",
 *     frontend_port_start=80,
 *     frontend_port_end=81,
 *     backend_port=8080,
 *     frontend_ip_configuration_name="PublicIPAddress")
 * ```
 * ```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 exampleNatPool = new Azure.Lb.NatPool("example", new()
 *     {
 *         ResourceGroupName = example.Name,
 *         LoadbalancerId = exampleLoadBalancer.Id,
 *         Name = "SampleApplicationPool",
 *         Protocol = "Tcp",
 *         FrontendPortStart = 80,
 *         FrontendPortEnd = 81,
 *         BackendPort = 8080,
 *         FrontendIpConfigurationName = "PublicIPAddress",
 *     });
 * });
 * ```
 * ```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.NewNatPool(ctx, "example", &lb.NatPoolArgs{
 * 			ResourceGroupName:           example.Name,
 * 			LoadbalancerId:              exampleLoadBalancer.ID(),
 * 			Name:                        pulumi.String("SampleApplicationPool"),
 * 			Protocol:                    pulumi.String("Tcp"),
 * 			FrontendPortStart:           pulumi.Int(80),
 * 			FrontendPortEnd:             pulumi.Int(81),
 * 			BackendPort:                 pulumi.Int(8080),
 * 			FrontendIpConfigurationName: pulumi.String("PublicIPAddress"),
 * 		})
 * 		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.NatPool;
 * import com.pulumi.azure.lb.NatPoolArgs;
 * 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 exampleNatPool = new NatPool("exampleNatPool", NatPoolArgs.builder()
 *             .resourceGroupName(example.name())
 *             .loadbalancerId(exampleLoadBalancer.id())
 *             .name("SampleApplicationPool")
 *             .protocol("Tcp")
 *             .frontendPortStart(80)
 *             .frontendPortEnd(81)
 *             .backendPort(8080)
 *             .frontendIpConfigurationName("PublicIPAddress")
 *             .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}
 *   exampleNatPool:
 *     type: azure:lb:NatPool
 *     name: example
 *     properties:
 *       resourceGroupName: ${example.name}
 *       loadbalancerId: ${exampleLoadBalancer.id}
 *       name: SampleApplicationPool
 *       protocol: Tcp
 *       frontendPortStart: 80
 *       frontendPortEnd: 81
 *       backendPort: 8080
 *       frontendIpConfigurationName: PublicIPAddress
 * ```
 * 
 * ## Import
 * Load Balancer NAT Pools can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:lb/natPool:NatPool example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatPools/pool1
 * ```
 * @property backendPort The port used for the internal endpoint. Possible values range between 1 and 65535, inclusive.
 * @property floatingIpEnabled Are the floating IPs enabled for this Load Balancer Rule? A floating IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group.
 * @property frontendIpConfigurationName The name of the frontend IP configuration exposing this rule.
 * @property frontendPortEnd The last port number in the range of external ports that will be used to provide Inbound NAT to NICs associated with this Load Balancer. Possible values range between 1 and 65534, inclusive.
 * @property frontendPortStart The first port number in the range of external ports that will be used to provide Inbound NAT to NICs associated with this Load Balancer. Possible values range between 1 and 65534, inclusive.
 * @property idleTimeoutInMinutes Specifies the idle timeout in minutes for TCP connections. Valid values are between `4` and `30`. Defaults to `4`.
 * @property loadbalancerId The ID of the Load Balancer in which to create the NAT pool. Changing this forces a new resource to be created.
 * @property name Specifies the name of the NAT pool. Changing this forces a new resource to be created.
 * @property protocol The transport protocol for the external endpoint. Possible values are `All`, `Tcp` and `Udp`.
 * @property resourceGroupName The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
 * @property tcpResetEnabled Is TCP Reset enabled for this Load Balancer Rule?
 */
public data class NatPoolArgs(
    public val backendPort: Output? = null,
    public val floatingIpEnabled: Output? = null,
    public val frontendIpConfigurationName: Output? = null,
    public val frontendPortEnd: Output? = null,
    public val frontendPortStart: Output? = null,
    public val idleTimeoutInMinutes: Output? = null,
    public val loadbalancerId: Output? = null,
    public val name: Output? = null,
    public val protocol: Output? = null,
    public val resourceGroupName: Output? = null,
    public val tcpResetEnabled: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.lb.NatPoolArgs = com.pulumi.azure.lb.NatPoolArgs.builder()
        .backendPort(backendPort?.applyValue({ args0 -> args0 }))
        .floatingIpEnabled(floatingIpEnabled?.applyValue({ args0 -> args0 }))
        .frontendIpConfigurationName(frontendIpConfigurationName?.applyValue({ args0 -> args0 }))
        .frontendPortEnd(frontendPortEnd?.applyValue({ args0 -> args0 }))
        .frontendPortStart(frontendPortStart?.applyValue({ args0 -> args0 }))
        .idleTimeoutInMinutes(idleTimeoutInMinutes?.applyValue({ args0 -> args0 }))
        .loadbalancerId(loadbalancerId?.applyValue({ args0 -> args0 }))
        .name(name?.applyValue({ args0 -> args0 }))
        .protocol(protocol?.applyValue({ args0 -> args0 }))
        .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
        .tcpResetEnabled(tcpResetEnabled?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [NatPoolArgs].
 */
@PulumiTagMarker
public class NatPoolArgsBuilder internal constructor() {
    private var backendPort: Output? = null

    private var floatingIpEnabled: Output? = null

    private var frontendIpConfigurationName: Output? = null

    private var frontendPortEnd: Output? = null

    private var frontendPortStart: Output? = null

    private var idleTimeoutInMinutes: Output? = null

    private var loadbalancerId: Output? = null

    private var name: Output? = null

    private var protocol: Output? = null

    private var resourceGroupName: Output? = null

    private var tcpResetEnabled: Output? = null

    /**
     * @param value The port used for the internal endpoint. Possible values range between 1 and 65535, inclusive.
     */
    @JvmName("grusnbuoiwbwubpp")
    public suspend fun backendPort(`value`: Output) {
        this.backendPort = value
    }

    /**
     * @param value Are the floating IPs enabled for this Load Balancer Rule? A floating IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group.
     */
    @JvmName("pnrraewkucwsppoa")
    public suspend fun floatingIpEnabled(`value`: Output) {
        this.floatingIpEnabled = value
    }

    /**
     * @param value The name of the frontend IP configuration exposing this rule.
     */
    @JvmName("cgimuumkelkggamd")
    public suspend fun frontendIpConfigurationName(`value`: Output) {
        this.frontendIpConfigurationName = value
    }

    /**
     * @param value The last port number in the range of external ports that will be used to provide Inbound NAT to NICs associated with this Load Balancer. Possible values range between 1 and 65534, inclusive.
     */
    @JvmName("goxqywvpkfiokajf")
    public suspend fun frontendPortEnd(`value`: Output) {
        this.frontendPortEnd = value
    }

    /**
     * @param value The first port number in the range of external ports that will be used to provide Inbound NAT to NICs associated with this Load Balancer. Possible values range between 1 and 65534, inclusive.
     */
    @JvmName("tmpdrasgorxuoary")
    public suspend fun frontendPortStart(`value`: Output) {
        this.frontendPortStart = value
    }

    /**
     * @param value Specifies the idle timeout in minutes for TCP connections. Valid values are between `4` and `30`. Defaults to `4`.
     */
    @JvmName("diqwakhovhvmbdqk")
    public suspend fun idleTimeoutInMinutes(`value`: Output) {
        this.idleTimeoutInMinutes = value
    }

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

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

    /**
     * @param value The transport protocol for the external endpoint. Possible values are `All`, `Tcp` and `Udp`.
     */
    @JvmName("vcrgbajlittcdmbt")
    public suspend fun protocol(`value`: Output) {
        this.protocol = value
    }

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

    /**
     * @param value Is TCP Reset enabled for this Load Balancer Rule?
     */
    @JvmName("soogdcogsjkgimna")
    public suspend fun tcpResetEnabled(`value`: Output) {
        this.tcpResetEnabled = value
    }

    /**
     * @param value The port used for the internal endpoint. Possible values range between 1 and 65535, inclusive.
     */
    @JvmName("nxeueddglkloksdn")
    public suspend fun backendPort(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.backendPort = mapped
    }

    /**
     * @param value Are the floating IPs enabled for this Load Balancer Rule? A floating IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group.
     */
    @JvmName("nxhomyhedhmssjvw")
    public suspend fun floatingIpEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.floatingIpEnabled = mapped
    }

    /**
     * @param value The name of the frontend IP configuration exposing this rule.
     */
    @JvmName("nbxnjkrnodhvukpj")
    public suspend fun frontendIpConfigurationName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.frontendIpConfigurationName = mapped
    }

    /**
     * @param value The last port number in the range of external ports that will be used to provide Inbound NAT to NICs associated with this Load Balancer. Possible values range between 1 and 65534, inclusive.
     */
    @JvmName("dfkwapdjgxwhjcdr")
    public suspend fun frontendPortEnd(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.frontendPortEnd = mapped
    }

    /**
     * @param value The first port number in the range of external ports that will be used to provide Inbound NAT to NICs associated with this Load Balancer. Possible values range between 1 and 65534, inclusive.
     */
    @JvmName("yvbfeeyuipcvpfka")
    public suspend fun frontendPortStart(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.frontendPortStart = mapped
    }

    /**
     * @param value Specifies the idle timeout in minutes for TCP connections. Valid values are between `4` and `30`. Defaults to `4`.
     */
    @JvmName("udcnrxqocgwyfaiq")
    public suspend fun idleTimeoutInMinutes(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.idleTimeoutInMinutes = mapped
    }

    /**
     * @param value The ID of the Load Balancer in which to create the NAT pool. Changing this forces a new resource to be created.
     */
    @JvmName("etqplptihummadkh")
    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 NAT pool. Changing this forces a new resource to be created.
     */
    @JvmName("tlruqtltgbwhthck")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The transport protocol for the external endpoint. Possible values are `All`, `Tcp` and `Udp`.
     */
    @JvmName("cvsxwqntorcuvwta")
    public suspend fun protocol(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

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

    /**
     * @param value Is TCP Reset enabled for this Load Balancer Rule?
     */
    @JvmName("nwshfncorytopdlx")
    public suspend fun tcpResetEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tcpResetEnabled = mapped
    }

    internal fun build(): NatPoolArgs = NatPoolArgs(
        backendPort = backendPort,
        floatingIpEnabled = floatingIpEnabled,
        frontendIpConfigurationName = frontendIpConfigurationName,
        frontendPortEnd = frontendPortEnd,
        frontendPortStart = frontendPortStart,
        idleTimeoutInMinutes = idleTimeoutInMinutes,
        loadbalancerId = loadbalancerId,
        name = name,
        protocol = protocol,
        resourceGroupName = resourceGroupName,
        tcpResetEnabled = tcpResetEnabled,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy