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

com.pulumi.cloudflare.kotlin.inputs.LoadBalancerPoolOriginArgs.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin.inputs

import com.pulumi.cloudflare.inputs.LoadBalancerPoolOriginArgs.builder
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.Double
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property address The IP address (IPv4 or IPv6) of the origin, or the publicly addressable hostname.
 * @property enabled Whether this origin is enabled. Disabled origins will not receive traffic and are excluded from health checks. Defaults to `true`.
 * @property headers HTTP request headers.
 * @property name A human-identifiable name for the origin.
 * @property virtualNetworkId The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account.
 * @property weight The weight (0.01 - 1.00) of this origin, relative to other origins in the pool. Equal values mean equal weighting. A weight of 0 means traffic will not be sent to this origin, but health is still checked. When `origin_steering.policy="least_outstanding_requests"`, weight is used to scale the origin's outstanding requests. When `origin_steering.policy="least_connections"`, weight is used to scale the origin's open connections. Defaults to `1`.
 */
public data class LoadBalancerPoolOriginArgs(
    public val address: Output,
    public val enabled: Output? = null,
    public val headers: Output>? = null,
    public val name: Output,
    public val virtualNetworkId: Output? = null,
    public val weight: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.inputs.LoadBalancerPoolOriginArgs =
        com.pulumi.cloudflare.inputs.LoadBalancerPoolOriginArgs.builder()
            .address(address.applyValue({ args0 -> args0 }))
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .headers(
                headers?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .name(name.applyValue({ args0 -> args0 }))
            .virtualNetworkId(virtualNetworkId?.applyValue({ args0 -> args0 }))
            .weight(weight?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [LoadBalancerPoolOriginArgs].
 */
@PulumiTagMarker
public class LoadBalancerPoolOriginArgsBuilder internal constructor() {
    private var address: Output? = null

    private var enabled: Output? = null

    private var headers: Output>? = null

    private var name: Output? = null

    private var virtualNetworkId: Output? = null

    private var weight: Output? = null

    /**
     * @param value The IP address (IPv4 or IPv6) of the origin, or the publicly addressable hostname.
     */
    @JvmName("duymxajaugnjrpba")
    public suspend fun address(`value`: Output) {
        this.address = value
    }

    /**
     * @param value Whether this origin is enabled. Disabled origins will not receive traffic and are excluded from health checks. Defaults to `true`.
     */
    @JvmName("wdcwueltittjgiwn")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value HTTP request headers.
     */
    @JvmName("umnmuxmadtmxthpj")
    public suspend fun headers(`value`: Output>) {
        this.headers = value
    }

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

    /**
     * @param values HTTP request headers.
     */
    @JvmName("fdltousylynlffqh")
    public suspend fun headers(values: List>) {
        this.headers = Output.all(values)
    }

    /**
     * @param value A human-identifiable name for the origin.
     */
    @JvmName("olucvaqexogcrmdl")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account.
     */
    @JvmName("sfvliehdrysuouqm")
    public suspend fun virtualNetworkId(`value`: Output) {
        this.virtualNetworkId = value
    }

    /**
     * @param value The weight (0.01 - 1.00) of this origin, relative to other origins in the pool. Equal values mean equal weighting. A weight of 0 means traffic will not be sent to this origin, but health is still checked. When `origin_steering.policy="least_outstanding_requests"`, weight is used to scale the origin's outstanding requests. When `origin_steering.policy="least_connections"`, weight is used to scale the origin's open connections. Defaults to `1`.
     */
    @JvmName("fxujonttyhhhqxtx")
    public suspend fun weight(`value`: Output) {
        this.weight = value
    }

    /**
     * @param value The IP address (IPv4 or IPv6) of the origin, or the publicly addressable hostname.
     */
    @JvmName("uhcobbmxlvjpbfso")
    public suspend fun address(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.address = mapped
    }

    /**
     * @param value Whether this origin is enabled. Disabled origins will not receive traffic and are excluded from health checks. Defaults to `true`.
     */
    @JvmName("ayghxonrxpaknfiu")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value HTTP request headers.
     */
    @JvmName("cflcuyadpbyhfxvf")
    public suspend fun headers(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.headers = mapped
    }

    /**
     * @param argument HTTP request headers.
     */
    @JvmName("tlekheqdqsfnbndt")
    public suspend fun headers(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerPoolOriginHeaderArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.headers = mapped
    }

    /**
     * @param argument HTTP request headers.
     */
    @JvmName("ngipcroufnqmwbyo")
    public suspend fun headers(vararg argument: suspend LoadBalancerPoolOriginHeaderArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerPoolOriginHeaderArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.headers = mapped
    }

    /**
     * @param argument HTTP request headers.
     */
    @JvmName("urcvhyqkdjtvgajt")
    public suspend fun headers(argument: suspend LoadBalancerPoolOriginHeaderArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            LoadBalancerPoolOriginHeaderArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.headers = mapped
    }

    /**
     * @param values HTTP request headers.
     */
    @JvmName("gbsnjlrvmhaywkav")
    public suspend fun headers(vararg values: LoadBalancerPoolOriginHeaderArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.headers = mapped
    }

    /**
     * @param value A human-identifiable name for the origin.
     */
    @JvmName("ifafibjktvxmyadn")
    public suspend fun name(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account.
     */
    @JvmName("cntoksnvqlklymwm")
    public suspend fun virtualNetworkId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.virtualNetworkId = mapped
    }

    /**
     * @param value The weight (0.01 - 1.00) of this origin, relative to other origins in the pool. Equal values mean equal weighting. A weight of 0 means traffic will not be sent to this origin, but health is still checked. When `origin_steering.policy="least_outstanding_requests"`, weight is used to scale the origin's outstanding requests. When `origin_steering.policy="least_connections"`, weight is used to scale the origin's open connections. Defaults to `1`.
     */
    @JvmName("ebdkxmvsyfutdvpv")
    public suspend fun weight(`value`: Double?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.weight = mapped
    }

    internal fun build(): LoadBalancerPoolOriginArgs = LoadBalancerPoolOriginArgs(
        address = address ?: throw PulumiNullFieldException("address"),
        enabled = enabled,
        headers = headers,
        name = name ?: throw PulumiNullFieldException("name"),
        virtualNetworkId = virtualNetworkId,
        weight = weight,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy