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

com.pulumi.azurenative.network.kotlin.inputs.LoadBalancingRuleArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.network.kotlin.inputs

import com.pulumi.azurenative.network.inputs.LoadBalancingRuleArgs.builder
import com.pulumi.azurenative.network.kotlin.enums.LoadDistribution
import com.pulumi.azurenative.network.kotlin.enums.TransportProtocol
import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * A load balancing rule for a load balancer.
 * @property backendAddressPool A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs.
 * @property backendAddressPools An array of references to pool of DIPs.
 * @property backendPort The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port".
 * @property disableOutboundSnat Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule.
 * @property enableFloatingIP Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.
 * @property enableTcpReset Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.
 * @property frontendIPConfiguration A reference to frontend IP addresses.
 * @property frontendPort The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port".
 * @property id Resource ID.
 * @property idleTimeoutInMinutes The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.
 * @property loadDistribution The load distribution policy for this rule.
 * @property name The name of the resource that is unique within the set of load balancing rules used by the load balancer. This name can be used to access the resource.
 * @property probe The reference to the load balancer probe used by the load balancing rule.
 * @property protocol The reference to the transport protocol used by the load balancing rule.
 */
public data class LoadBalancingRuleArgs(
    public val backendAddressPool: Output? = null,
    public val backendAddressPools: Output>? = null,
    public val backendPort: Output? = null,
    public val disableOutboundSnat: Output? = null,
    public val enableFloatingIP: Output? = null,
    public val enableTcpReset: Output? = null,
    public val frontendIPConfiguration: Output? = null,
    public val frontendPort: Output,
    public val id: Output? = null,
    public val idleTimeoutInMinutes: Output? = null,
    public val loadDistribution: Output>? = null,
    public val name: Output? = null,
    public val probe: Output? = null,
    public val protocol: Output>,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.network.inputs.LoadBalancingRuleArgs =
        com.pulumi.azurenative.network.inputs.LoadBalancingRuleArgs.builder()
            .backendAddressPool(
                backendAddressPool?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .backendAddressPools(
                backendAddressPools?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .backendPort(backendPort?.applyValue({ args0 -> args0 }))
            .disableOutboundSnat(disableOutboundSnat?.applyValue({ args0 -> args0 }))
            .enableFloatingIP(enableFloatingIP?.applyValue({ args0 -> args0 }))
            .enableTcpReset(enableTcpReset?.applyValue({ args0 -> args0 }))
            .frontendIPConfiguration(
                frontendIPConfiguration?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .frontendPort(frontendPort.applyValue({ args0 -> args0 }))
            .id(id?.applyValue({ args0 -> args0 }))
            .idleTimeoutInMinutes(idleTimeoutInMinutes?.applyValue({ args0 -> args0 }))
            .loadDistribution(
                loadDistribution?.applyValue({ args0 ->
                    args0.transform(
                        { args0 -> args0 },
                        { args0 -> args0.let({ args0 -> args0.toJava() }) },
                    )
                }),
            )
            .name(name?.applyValue({ args0 -> args0 }))
            .probe(probe?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .protocol(
                protocol.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            ).build()
}

/**
 * Builder for [LoadBalancingRuleArgs].
 */
@PulumiTagMarker
public class LoadBalancingRuleArgsBuilder internal constructor() {
    private var backendAddressPool: Output? = null

    private var backendAddressPools: Output>? = null

    private var backendPort: Output? = null

    private var disableOutboundSnat: Output? = null

    private var enableFloatingIP: Output? = null

    private var enableTcpReset: Output? = null

    private var frontendIPConfiguration: Output? = null

    private var frontendPort: Output? = null

    private var id: Output? = null

    private var idleTimeoutInMinutes: Output? = null

    private var loadDistribution: Output>? = null

    private var name: Output? = null

    private var probe: Output? = null

    private var protocol: Output>? = null

    /**
     * @param value A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs.
     */
    @JvmName("rwheweecxykrlkia")
    public suspend fun backendAddressPool(`value`: Output) {
        this.backendAddressPool = value
    }

    /**
     * @param value An array of references to pool of DIPs.
     */
    @JvmName("nhxdddarsqncbmjr")
    public suspend fun backendAddressPools(`value`: Output>) {
        this.backendAddressPools = value
    }

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

    /**
     * @param values An array of references to pool of DIPs.
     */
    @JvmName("hgbpnjjjbnfaudbt")
    public suspend fun backendAddressPools(values: List>) {
        this.backendAddressPools = Output.all(values)
    }

    /**
     * @param value The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port".
     */
    @JvmName("nsmrmhchwvxddiji")
    public suspend fun backendPort(`value`: Output) {
        this.backendPort = value
    }

    /**
     * @param value Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule.
     */
    @JvmName("wcpcddxiqklujion")
    public suspend fun disableOutboundSnat(`value`: Output) {
        this.disableOutboundSnat = value
    }

    /**
     * @param value Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.
     */
    @JvmName("ynxkalhuiminhqms")
    public suspend fun enableFloatingIP(`value`: Output) {
        this.enableFloatingIP = value
    }

    /**
     * @param value Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.
     */
    @JvmName("gmufnvrksrqouhti")
    public suspend fun enableTcpReset(`value`: Output) {
        this.enableTcpReset = value
    }

    /**
     * @param value A reference to frontend IP addresses.
     */
    @JvmName("ifddtygifcfvxtso")
    public suspend fun frontendIPConfiguration(`value`: Output) {
        this.frontendIPConfiguration = value
    }

    /**
     * @param value The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port".
     */
    @JvmName("qrccnmyfhiojbkdx")
    public suspend fun frontendPort(`value`: Output) {
        this.frontendPort = value
    }

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

    /**
     * @param value The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.
     */
    @JvmName("isnyxsgwwsywhodd")
    public suspend fun idleTimeoutInMinutes(`value`: Output) {
        this.idleTimeoutInMinutes = value
    }

    /**
     * @param value The load distribution policy for this rule.
     */
    @JvmName("jyewmbvbnddbrkcm")
    public suspend fun loadDistribution(`value`: Output>) {
        this.loadDistribution = value
    }

    /**
     * @param value The name of the resource that is unique within the set of load balancing rules used by the load balancer. This name can be used to access the resource.
     */
    @JvmName("fjfjocwjfbcfsnnf")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The reference to the load balancer probe used by the load balancing rule.
     */
    @JvmName("tnfrptuqajxjbgex")
    public suspend fun probe(`value`: Output) {
        this.probe = value
    }

    /**
     * @param value The reference to the transport protocol used by the load balancing rule.
     */
    @JvmName("puegddsvludhtbqv")
    public suspend fun protocol(`value`: Output>) {
        this.protocol = value
    }

    /**
     * @param value A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs.
     */
    @JvmName("ckocuedxbtumnely")
    public suspend fun backendAddressPool(`value`: SubResourceArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.backendAddressPool = mapped
    }

    /**
     * @param argument A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs.
     */
    @JvmName("bjfusntjdcmcvhae")
    public suspend fun backendAddressPool(argument: suspend SubResourceArgsBuilder.() -> Unit) {
        val toBeMapped = SubResourceArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.backendAddressPool = mapped
    }

    /**
     * @param value An array of references to pool of DIPs.
     */
    @JvmName("lpgxpacxtfymvshu")
    public suspend fun backendAddressPools(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.backendAddressPools = mapped
    }

    /**
     * @param argument An array of references to pool of DIPs.
     */
    @JvmName("nkfswtpuutimkiys")
    public suspend fun backendAddressPools(argument: List Unit>) {
        val toBeMapped = argument.toList().map { SubResourceArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.backendAddressPools = mapped
    }

    /**
     * @param argument An array of references to pool of DIPs.
     */
    @JvmName("lmbqtsvfogecvowu")
    public suspend fun backendAddressPools(vararg argument: suspend SubResourceArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { SubResourceArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.backendAddressPools = mapped
    }

    /**
     * @param argument An array of references to pool of DIPs.
     */
    @JvmName("tbbdisakjgrquwjm")
    public suspend fun backendAddressPools(argument: suspend SubResourceArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(SubResourceArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.backendAddressPools = mapped
    }

    /**
     * @param values An array of references to pool of DIPs.
     */
    @JvmName("vxpsyeovpxjiinvt")
    public suspend fun backendAddressPools(vararg values: SubResourceArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.backendAddressPools = mapped
    }

    /**
     * @param value The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port".
     */
    @JvmName("yhfodlgevijvhbkt")
    public suspend fun backendPort(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.backendPort = mapped
    }

    /**
     * @param value Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule.
     */
    @JvmName("gltgyuywrnihccyc")
    public suspend fun disableOutboundSnat(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disableOutboundSnat = mapped
    }

    /**
     * @param value Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.
     */
    @JvmName("cqxttlecevtgosce")
    public suspend fun enableFloatingIP(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enableFloatingIP = mapped
    }

    /**
     * @param value Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.
     */
    @JvmName("aatkxdtitdtdkmaw")
    public suspend fun enableTcpReset(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enableTcpReset = mapped
    }

    /**
     * @param value A reference to frontend IP addresses.
     */
    @JvmName("yqwwuorfuyydajaw")
    public suspend fun frontendIPConfiguration(`value`: SubResourceArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.frontendIPConfiguration = mapped
    }

    /**
     * @param argument A reference to frontend IP addresses.
     */
    @JvmName("tismsebhowbqajth")
    public suspend fun frontendIPConfiguration(argument: suspend SubResourceArgsBuilder.() -> Unit) {
        val toBeMapped = SubResourceArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.frontendIPConfiguration = mapped
    }

    /**
     * @param value The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port".
     */
    @JvmName("wsjjfbhbjqklkwld")
    public suspend fun frontendPort(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.frontendPort = mapped
    }

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

    /**
     * @param value The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.
     */
    @JvmName("vnvgddwbrihqeenp")
    public suspend fun idleTimeoutInMinutes(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.idleTimeoutInMinutes = mapped
    }

    /**
     * @param value The load distribution policy for this rule.
     */
    @JvmName("qkoywxerqyjpxxss")
    public suspend fun loadDistribution(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.loadDistribution = mapped
    }

    /**
     * @param value The load distribution policy for this rule.
     */
    @JvmName("vvdaecqqiwqstiwp")
    public fun loadDistribution(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.loadDistribution = mapped
    }

    /**
     * @param value The load distribution policy for this rule.
     */
    @JvmName("uwnkgxtfwwrxsadb")
    public fun loadDistribution(`value`: LoadDistribution) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.loadDistribution = mapped
    }

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

    /**
     * @param value The reference to the load balancer probe used by the load balancing rule.
     */
    @JvmName("popdsmnwwkeyklww")
    public suspend fun probe(`value`: SubResourceArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.probe = mapped
    }

    /**
     * @param argument The reference to the load balancer probe used by the load balancing rule.
     */
    @JvmName("dmmbbiytrcvhqulu")
    public suspend fun probe(argument: suspend SubResourceArgsBuilder.() -> Unit) {
        val toBeMapped = SubResourceArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.probe = mapped
    }

    /**
     * @param value The reference to the transport protocol used by the load balancing rule.
     */
    @JvmName("qwmquppeakmthfsb")
    public suspend fun protocol(`value`: Either) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value The reference to the transport protocol used by the load balancing rule.
     */
    @JvmName("wcksopiwgifoelrp")
    public fun protocol(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value The reference to the transport protocol used by the load balancing rule.
     */
    @JvmName("naaksjhlynpmhjqm")
    public fun protocol(`value`: TransportProtocol) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    internal fun build(): LoadBalancingRuleArgs = LoadBalancingRuleArgs(
        backendAddressPool = backendAddressPool,
        backendAddressPools = backendAddressPools,
        backendPort = backendPort,
        disableOutboundSnat = disableOutboundSnat,
        enableFloatingIP = enableFloatingIP,
        enableTcpReset = enableTcpReset,
        frontendIPConfiguration = frontendIPConfiguration,
        frontendPort = frontendPort ?: throw PulumiNullFieldException("frontendPort"),
        id = id,
        idleTimeoutInMinutes = idleTimeoutInMinutes,
        loadDistribution = loadDistribution,
        name = name,
        probe = probe,
        protocol = protocol ?: throw PulumiNullFieldException("protocol"),
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy