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

com.pulumi.cloudflare.kotlin.LoadBalancerMonitorArgs.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: 5.47.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.cloudflare.LoadBalancerMonitorArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerMonitorHeaderArgs
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerMonitorHeaderArgsBuilder
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.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * If Cloudflare's Load Balancing to load-balance across multiple
 * origin servers or data centers, you configure one of these Monitors
 * to actively check the availability of those servers over HTTP(S) or
 * TCP.
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/loadBalancerMonitor:LoadBalancerMonitor example /
 * ```
 * @property accountId The account identifier to target for the resource.
 * @property allowInsecure Do not validate the certificate when monitor use HTTPS.  Only valid if `type` is "http" or "https".
 * @property consecutiveDown To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. Defaults to `0`.
 * @property consecutiveUp To be marked healthy the monitored origin must pass this healthcheck N consecutive times. Defaults to `0`.
 * @property description Free text description.
 * @property expectedBody A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. Only valid if `type` is "http" or "https".
 * @property expectedCodes The expected HTTP response code or code range of the health check. Eg `2xx`. Only valid and required if `type` is "http" or "https".
 * @property followRedirects Follow redirects if returned by the origin. Only valid if `type` is "http" or "https".
 * @property headers The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.
 * @property interval The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. Defaults to `60`.
 * @property method The method to use for the health check.
 * @property path The endpoint path to health check against.
 * @property port The port number to use for the healthcheck, required when creating a TCP monitor.
 * @property probeZone Assign this monitor to emulate the specified zone while probing. Only valid if `type` is "http" or "https".
 * @property retries The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to `2`.
 * @property timeout The timeout (in seconds) before marking the health check as failed. Defaults to `5`.
 * @property type The protocol to use for the healthcheck. Available values: `http`, `https`, `tcp`, `udp_icmp`, `icmp_ping`, `smtp`. Defaults to `http`.
 */
public data class LoadBalancerMonitorArgs(
    public val accountId: Output? = null,
    public val allowInsecure: Output? = null,
    public val consecutiveDown: Output? = null,
    public val consecutiveUp: Output? = null,
    public val description: Output? = null,
    public val expectedBody: Output? = null,
    public val expectedCodes: Output? = null,
    public val followRedirects: Output? = null,
    public val headers: Output>? = null,
    public val interval: Output? = null,
    public val method: Output? = null,
    public val path: Output? = null,
    public val port: Output? = null,
    public val probeZone: Output? = null,
    public val retries: Output? = null,
    public val timeout: Output? = null,
    public val type: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.LoadBalancerMonitorArgs =
        com.pulumi.cloudflare.LoadBalancerMonitorArgs.builder()
            .accountId(accountId?.applyValue({ args0 -> args0 }))
            .allowInsecure(allowInsecure?.applyValue({ args0 -> args0 }))
            .consecutiveDown(consecutiveDown?.applyValue({ args0 -> args0 }))
            .consecutiveUp(consecutiveUp?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .expectedBody(expectedBody?.applyValue({ args0 -> args0 }))
            .expectedCodes(expectedCodes?.applyValue({ args0 -> args0 }))
            .followRedirects(followRedirects?.applyValue({ args0 -> args0 }))
            .headers(
                headers?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .interval(interval?.applyValue({ args0 -> args0 }))
            .method(method?.applyValue({ args0 -> args0 }))
            .path(path?.applyValue({ args0 -> args0 }))
            .port(port?.applyValue({ args0 -> args0 }))
            .probeZone(probeZone?.applyValue({ args0 -> args0 }))
            .retries(retries?.applyValue({ args0 -> args0 }))
            .timeout(timeout?.applyValue({ args0 -> args0 }))
            .type(type?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [LoadBalancerMonitorArgs].
 */
@PulumiTagMarker
public class LoadBalancerMonitorArgsBuilder internal constructor() {
    private var accountId: Output? = null

    private var allowInsecure: Output? = null

    private var consecutiveDown: Output? = null

    private var consecutiveUp: Output? = null

    private var description: Output? = null

    private var expectedBody: Output? = null

    private var expectedCodes: Output? = null

    private var followRedirects: Output? = null

    private var headers: Output>? = null

    private var interval: Output? = null

    private var method: Output? = null

    private var path: Output? = null

    private var port: Output? = null

    private var probeZone: Output? = null

    private var retries: Output? = null

    private var timeout: Output? = null

    private var type: Output? = null

    /**
     * @param value The account identifier to target for the resource.
     */
    @JvmName("gleqwmansyhikbmb")
    public suspend fun accountId(`value`: Output) {
        this.accountId = value
    }

    /**
     * @param value Do not validate the certificate when monitor use HTTPS.  Only valid if `type` is "http" or "https".
     */
    @JvmName("cqtxrgpicuxsjwbw")
    public suspend fun allowInsecure(`value`: Output) {
        this.allowInsecure = value
    }

    /**
     * @param value To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. Defaults to `0`.
     */
    @JvmName("lyndjxxfkbbklllx")
    public suspend fun consecutiveDown(`value`: Output) {
        this.consecutiveDown = value
    }

    /**
     * @param value To be marked healthy the monitored origin must pass this healthcheck N consecutive times. Defaults to `0`.
     */
    @JvmName("bcpnuwfspocwefoo")
    public suspend fun consecutiveUp(`value`: Output) {
        this.consecutiveUp = value
    }

    /**
     * @param value Free text description.
     */
    @JvmName("mkqfyiumvkiuttne")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. Only valid if `type` is "http" or "https".
     */
    @JvmName("wexjoichbrkljrhy")
    public suspend fun expectedBody(`value`: Output) {
        this.expectedBody = value
    }

    /**
     * @param value The expected HTTP response code or code range of the health check. Eg `2xx`. Only valid and required if `type` is "http" or "https".
     */
    @JvmName("lxxwvdwnpvkswuou")
    public suspend fun expectedCodes(`value`: Output) {
        this.expectedCodes = value
    }

    /**
     * @param value Follow redirects if returned by the origin. Only valid if `type` is "http" or "https".
     */
    @JvmName("jylmiiukxldaiunt")
    public suspend fun followRedirects(`value`: Output) {
        this.followRedirects = value
    }

    /**
     * @param value The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.
     */
    @JvmName("jaesnougvcbcalmt")
    public suspend fun headers(`value`: Output>) {
        this.headers = value
    }

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

    /**
     * @param values The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.
     */
    @JvmName("cyjreiuaqoildafl")
    public suspend fun headers(values: List>) {
        this.headers = Output.all(values)
    }

    /**
     * @param value The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. Defaults to `60`.
     */
    @JvmName("pdwwqwrfcrgfjjkj")
    public suspend fun interval(`value`: Output) {
        this.interval = value
    }

    /**
     * @param value The method to use for the health check.
     */
    @JvmName("bxwuudsbutmjputk")
    public suspend fun method(`value`: Output) {
        this.method = value
    }

    /**
     * @param value The endpoint path to health check against.
     */
    @JvmName("nqhdncjfumpwpqnq")
    public suspend fun path(`value`: Output) {
        this.path = value
    }

    /**
     * @param value The port number to use for the healthcheck, required when creating a TCP monitor.
     */
    @JvmName("jqjtyhfhpaschqdi")
    public suspend fun port(`value`: Output) {
        this.port = value
    }

    /**
     * @param value Assign this monitor to emulate the specified zone while probing. Only valid if `type` is "http" or "https".
     */
    @JvmName("kyaxifufkrbqltij")
    public suspend fun probeZone(`value`: Output) {
        this.probeZone = value
    }

    /**
     * @param value The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to `2`.
     */
    @JvmName("hrnxpylpmuhqyiaw")
    public suspend fun retries(`value`: Output) {
        this.retries = value
    }

    /**
     * @param value The timeout (in seconds) before marking the health check as failed. Defaults to `5`.
     */
    @JvmName("xmcgfrvnjcmtlcwl")
    public suspend fun timeout(`value`: Output) {
        this.timeout = value
    }

    /**
     * @param value The protocol to use for the healthcheck. Available values: `http`, `https`, `tcp`, `udp_icmp`, `icmp_ping`, `smtp`. Defaults to `http`.
     */
    @JvmName("pffonsraeaauvsih")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value The account identifier to target for the resource.
     */
    @JvmName("nsijviaqjovrbsdn")
    public suspend fun accountId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accountId = mapped
    }

    /**
     * @param value Do not validate the certificate when monitor use HTTPS.  Only valid if `type` is "http" or "https".
     */
    @JvmName("ixbumbkfyivthqgu")
    public suspend fun allowInsecure(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowInsecure = mapped
    }

    /**
     * @param value To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. Defaults to `0`.
     */
    @JvmName("geqfjctnnatxbbkm")
    public suspend fun consecutiveDown(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.consecutiveDown = mapped
    }

    /**
     * @param value To be marked healthy the monitored origin must pass this healthcheck N consecutive times. Defaults to `0`.
     */
    @JvmName("pkjtqgddwrcchrkj")
    public suspend fun consecutiveUp(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.consecutiveUp = mapped
    }

    /**
     * @param value Free text description.
     */
    @JvmName("qjoexsoyrftimpkk")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. Only valid if `type` is "http" or "https".
     */
    @JvmName("xoektfhkegkpmnvw")
    public suspend fun expectedBody(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expectedBody = mapped
    }

    /**
     * @param value The expected HTTP response code or code range of the health check. Eg `2xx`. Only valid and required if `type` is "http" or "https".
     */
    @JvmName("kcxwadwkovtkvulq")
    public suspend fun expectedCodes(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expectedCodes = mapped
    }

    /**
     * @param value Follow redirects if returned by the origin. Only valid if `type` is "http" or "https".
     */
    @JvmName("syodpcqjtoskyvkm")
    public suspend fun followRedirects(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.followRedirects = mapped
    }

    /**
     * @param value The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.
     */
    @JvmName("yqctflyvubheqkuv")
    public suspend fun headers(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.headers = mapped
    }

    /**
     * @param argument The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.
     */
    @JvmName("sjuemhqlmxclkrlu")
    public suspend fun headers(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerMonitorHeaderArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.headers = mapped
    }

    /**
     * @param argument The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.
     */
    @JvmName("giomfdneqjqpeosr")
    public suspend fun headers(vararg argument: suspend LoadBalancerMonitorHeaderArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerMonitorHeaderArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.headers = mapped
    }

    /**
     * @param argument The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.
     */
    @JvmName("frrerhpdxrbikuog")
    public suspend fun headers(argument: suspend LoadBalancerMonitorHeaderArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            LoadBalancerMonitorHeaderArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.headers = mapped
    }

    /**
     * @param values The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.
     */
    @JvmName("xfhladhawpegotqr")
    public suspend fun headers(vararg values: LoadBalancerMonitorHeaderArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.headers = mapped
    }

    /**
     * @param value The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. Defaults to `60`.
     */
    @JvmName("ccdecbqselsfaoaj")
    public suspend fun interval(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.interval = mapped
    }

    /**
     * @param value The method to use for the health check.
     */
    @JvmName("uvnimreyesqpyoqt")
    public suspend fun method(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.method = mapped
    }

    /**
     * @param value The endpoint path to health check against.
     */
    @JvmName("woqeehqexolsncsn")
    public suspend fun path(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.path = mapped
    }

    /**
     * @param value The port number to use for the healthcheck, required when creating a TCP monitor.
     */
    @JvmName("jgkiniekihrmvrpd")
    public suspend fun port(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.port = mapped
    }

    /**
     * @param value Assign this monitor to emulate the specified zone while probing. Only valid if `type` is "http" or "https".
     */
    @JvmName("ktkpoavkhcmmiwgi")
    public suspend fun probeZone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.probeZone = mapped
    }

    /**
     * @param value The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to `2`.
     */
    @JvmName("tydvwpbysrfoplhk")
    public suspend fun retries(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retries = mapped
    }

    /**
     * @param value The timeout (in seconds) before marking the health check as failed. Defaults to `5`.
     */
    @JvmName("nnulxheljxcysrkp")
    public suspend fun timeout(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeout = mapped
    }

    /**
     * @param value The protocol to use for the healthcheck. Available values: `http`, `https`, `tcp`, `udp_icmp`, `icmp_ping`, `smtp`. Defaults to `http`.
     */
    @JvmName("nwuoxiiclnxejbps")
    public suspend fun type(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    internal fun build(): LoadBalancerMonitorArgs = LoadBalancerMonitorArgs(
        accountId = accountId,
        allowInsecure = allowInsecure,
        consecutiveDown = consecutiveDown,
        consecutiveUp = consecutiveUp,
        description = description,
        expectedBody = expectedBody,
        expectedCodes = expectedCodes,
        followRedirects = followRedirects,
        headers = headers,
        interval = interval,
        method = method,
        path = path,
        port = port,
        probeZone = probeZone,
        retries = retries,
        timeout = timeout,
        type = type,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy