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

com.pulumi.cloudflare.kotlin.inputs.LoadBalancerSessionAffinityAttributeArgs.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.LoadBalancerSessionAffinityAttributeArgs.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.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property drainDuration Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer. Defaults to `0`.
 * @property headers Configures the HTTP header names to use when header session affinity is enabled.
 * @property requireAllHeaders Configures how headers are used when header session affinity is enabled. Set to true to require all headers to be present on requests in order for sessions to be created or false to require at least one header to be present. Defaults to `false`.
 * @property samesite Configures the SameSite attribute on session affinity cookie. Value `Auto` will be translated to `Lax` or `None` depending if Always Use HTTPS is enabled. Note: when using value `None`, then you can not set `secure="Never"`. Available values: `Auto`, `Lax`, `None`, `Strict`. Defaults to `Auto`.
 * @property secure Configures the Secure attribute on session affinity cookie. Value `Always` indicates the Secure attribute will be set in the Set-Cookie header, `Never` indicates the Secure attribute will not be set, and `Auto` will set the Secure attribute depending if Always Use HTTPS is enabled. Available values: `Auto`, `Always`, `Never`. Defaults to `Auto`.
 * @property zeroDowntimeFailover Configures the zero-downtime failover between origins within a pool when session affinity is enabled. Value `none` means no failover takes place for sessions pinned to the origin. Value `temporary` means traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. Value `sticky` means the session affinity cookie is updated and subsequent requests are sent to the new origin. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. Available values: `none`, `temporary`, `sticky`. Defaults to `none`.
 */
public data class LoadBalancerSessionAffinityAttributeArgs(
    public val drainDuration: Output? = null,
    public val headers: Output>? = null,
    public val requireAllHeaders: Output? = null,
    public val samesite: Output? = null,
    public val secure: Output? = null,
    public val zeroDowntimeFailover: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.inputs.LoadBalancerSessionAffinityAttributeArgs =
        com.pulumi.cloudflare.inputs.LoadBalancerSessionAffinityAttributeArgs.builder()
            .drainDuration(drainDuration?.applyValue({ args0 -> args0 }))
            .headers(headers?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .requireAllHeaders(requireAllHeaders?.applyValue({ args0 -> args0 }))
            .samesite(samesite?.applyValue({ args0 -> args0 }))
            .secure(secure?.applyValue({ args0 -> args0 }))
            .zeroDowntimeFailover(zeroDowntimeFailover?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [LoadBalancerSessionAffinityAttributeArgs].
 */
@PulumiTagMarker
public class LoadBalancerSessionAffinityAttributeArgsBuilder internal constructor() {
    private var drainDuration: Output? = null

    private var headers: Output>? = null

    private var requireAllHeaders: Output? = null

    private var samesite: Output? = null

    private var secure: Output? = null

    private var zeroDowntimeFailover: Output? = null

    /**
     * @param value Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer. Defaults to `0`.
     */
    @JvmName("jdkhvsxmuugvjhcu")
    public suspend fun drainDuration(`value`: Output) {
        this.drainDuration = value
    }

    /**
     * @param value Configures the HTTP header names to use when header session affinity is enabled.
     */
    @JvmName("lvyccycdujhtpsbh")
    public suspend fun headers(`value`: Output>) {
        this.headers = value
    }

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

    /**
     * @param values Configures the HTTP header names to use when header session affinity is enabled.
     */
    @JvmName("odceibdkbipxdjaw")
    public suspend fun headers(values: List>) {
        this.headers = Output.all(values)
    }

    /**
     * @param value Configures how headers are used when header session affinity is enabled. Set to true to require all headers to be present on requests in order for sessions to be created or false to require at least one header to be present. Defaults to `false`.
     */
    @JvmName("bdrmtfyusybpnpek")
    public suspend fun requireAllHeaders(`value`: Output) {
        this.requireAllHeaders = value
    }

    /**
     * @param value Configures the SameSite attribute on session affinity cookie. Value `Auto` will be translated to `Lax` or `None` depending if Always Use HTTPS is enabled. Note: when using value `None`, then you can not set `secure="Never"`. Available values: `Auto`, `Lax`, `None`, `Strict`. Defaults to `Auto`.
     */
    @JvmName("bnxvylcacgmnqtth")
    public suspend fun samesite(`value`: Output) {
        this.samesite = value
    }

    /**
     * @param value Configures the Secure attribute on session affinity cookie. Value `Always` indicates the Secure attribute will be set in the Set-Cookie header, `Never` indicates the Secure attribute will not be set, and `Auto` will set the Secure attribute depending if Always Use HTTPS is enabled. Available values: `Auto`, `Always`, `Never`. Defaults to `Auto`.
     */
    @JvmName("tvxkxhawlhacswnk")
    public suspend fun secure(`value`: Output) {
        this.secure = value
    }

    /**
     * @param value Configures the zero-downtime failover between origins within a pool when session affinity is enabled. Value `none` means no failover takes place for sessions pinned to the origin. Value `temporary` means traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. Value `sticky` means the session affinity cookie is updated and subsequent requests are sent to the new origin. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. Available values: `none`, `temporary`, `sticky`. Defaults to `none`.
     */
    @JvmName("aijjriwcyaxlqamm")
    public suspend fun zeroDowntimeFailover(`value`: Output) {
        this.zeroDowntimeFailover = value
    }

    /**
     * @param value Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer. Defaults to `0`.
     */
    @JvmName("ucamdjxaivbuttqa")
    public suspend fun drainDuration(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.drainDuration = mapped
    }

    /**
     * @param value Configures the HTTP header names to use when header session affinity is enabled.
     */
    @JvmName("doagcrykpbnuqfsk")
    public suspend fun headers(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.headers = mapped
    }

    /**
     * @param values Configures the HTTP header names to use when header session affinity is enabled.
     */
    @JvmName("qbrxhjeceslygviq")
    public suspend fun headers(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.headers = mapped
    }

    /**
     * @param value Configures how headers are used when header session affinity is enabled. Set to true to require all headers to be present on requests in order for sessions to be created or false to require at least one header to be present. Defaults to `false`.
     */
    @JvmName("hdnqsjfrjudecawj")
    public suspend fun requireAllHeaders(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requireAllHeaders = mapped
    }

    /**
     * @param value Configures the SameSite attribute on session affinity cookie. Value `Auto` will be translated to `Lax` or `None` depending if Always Use HTTPS is enabled. Note: when using value `None`, then you can not set `secure="Never"`. Available values: `Auto`, `Lax`, `None`, `Strict`. Defaults to `Auto`.
     */
    @JvmName("johjycecnyaxuiqk")
    public suspend fun samesite(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.samesite = mapped
    }

    /**
     * @param value Configures the Secure attribute on session affinity cookie. Value `Always` indicates the Secure attribute will be set in the Set-Cookie header, `Never` indicates the Secure attribute will not be set, and `Auto` will set the Secure attribute depending if Always Use HTTPS is enabled. Available values: `Auto`, `Always`, `Never`. Defaults to `Auto`.
     */
    @JvmName("ovydtgonecaighsf")
    public suspend fun secure(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secure = mapped
    }

    /**
     * @param value Configures the zero-downtime failover between origins within a pool when session affinity is enabled. Value `none` means no failover takes place for sessions pinned to the origin. Value `temporary` means traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. Value `sticky` means the session affinity cookie is updated and subsequent requests are sent to the new origin. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. Available values: `none`, `temporary`, `sticky`. Defaults to `none`.
     */
    @JvmName("cgjbleyxfwxuprol")
    public suspend fun zeroDowntimeFailover(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zeroDowntimeFailover = mapped
    }

    internal fun build(): LoadBalancerSessionAffinityAttributeArgs =
        LoadBalancerSessionAffinityAttributeArgs(
            drainDuration = drainDuration,
            headers = headers,
            requireAllHeaders = requireAllHeaders,
            samesite = samesite,
            secure = secure,
            zeroDowntimeFailover = zeroDowntimeFailover,
        )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy