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

com.pulumi.azurenative.app.kotlin.inputs.ContainerAppProbeArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.app.kotlin.inputs

import com.pulumi.azurenative.app.inputs.ContainerAppProbeArgs.builder
import com.pulumi.azurenative.app.kotlin.enums.Type
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.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Double
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.
 * @property failureThreshold Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. Maximum value is 10.
 * @property httpGet HTTPGet specifies the http request to perform.
 * @property initialDelaySeconds Number of seconds after the container has started before liveness probes are initiated. Minimum value is 1. Maximum value is 60.
 * @property periodSeconds How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Maximum value is 240.
 * @property successThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. Maximum value is 10.
 * @property tcpSocket TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported.
 * @property terminationGracePeriodSeconds Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. Maximum value is 3600 seconds (1 hour)
 * @property timeoutSeconds Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Maximum value is 240.
 * @property type The type of probe.
 */
public data class ContainerAppProbeArgs(
    public val failureThreshold: Output? = null,
    public val httpGet: Output? = null,
    public val initialDelaySeconds: Output? = null,
    public val periodSeconds: Output? = null,
    public val successThreshold: Output? = null,
    public val tcpSocket: Output? = null,
    public val terminationGracePeriodSeconds: Output? = null,
    public val timeoutSeconds: Output? = null,
    public val type: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.app.inputs.ContainerAppProbeArgs =
        com.pulumi.azurenative.app.inputs.ContainerAppProbeArgs.builder()
            .failureThreshold(failureThreshold?.applyValue({ args0 -> args0 }))
            .httpGet(httpGet?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .initialDelaySeconds(initialDelaySeconds?.applyValue({ args0 -> args0 }))
            .periodSeconds(periodSeconds?.applyValue({ args0 -> args0 }))
            .successThreshold(successThreshold?.applyValue({ args0 -> args0 }))
            .tcpSocket(tcpSocket?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .terminationGracePeriodSeconds(terminationGracePeriodSeconds?.applyValue({ args0 -> args0 }))
            .timeoutSeconds(timeoutSeconds?.applyValue({ args0 -> args0 }))
            .type(
                type?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [ContainerAppProbeArgs].
 */
@PulumiTagMarker
public class ContainerAppProbeArgsBuilder internal constructor() {
    private var failureThreshold: Output? = null

    private var httpGet: Output? = null

    private var initialDelaySeconds: Output? = null

    private var periodSeconds: Output? = null

    private var successThreshold: Output? = null

    private var tcpSocket: Output? = null

    private var terminationGracePeriodSeconds: Output? = null

    private var timeoutSeconds: Output? = null

    private var type: Output>? = null

    /**
     * @param value Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. Maximum value is 10.
     */
    @JvmName("uujkblbblhjahage")
    public suspend fun failureThreshold(`value`: Output) {
        this.failureThreshold = value
    }

    /**
     * @param value HTTPGet specifies the http request to perform.
     */
    @JvmName("mowtfjonucmnjjht")
    public suspend fun httpGet(`value`: Output) {
        this.httpGet = value
    }

    /**
     * @param value Number of seconds after the container has started before liveness probes are initiated. Minimum value is 1. Maximum value is 60.
     */
    @JvmName("whhludduquyikxku")
    public suspend fun initialDelaySeconds(`value`: Output) {
        this.initialDelaySeconds = value
    }

    /**
     * @param value How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Maximum value is 240.
     */
    @JvmName("bkxqmccjyoompdoo")
    public suspend fun periodSeconds(`value`: Output) {
        this.periodSeconds = value
    }

    /**
     * @param value Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. Maximum value is 10.
     */
    @JvmName("ydgvbtrqcfwcktns")
    public suspend fun successThreshold(`value`: Output) {
        this.successThreshold = value
    }

    /**
     * @param value TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported.
     */
    @JvmName("gckrhlvlppfsrowk")
    public suspend fun tcpSocket(`value`: Output) {
        this.tcpSocket = value
    }

    /**
     * @param value Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. Maximum value is 3600 seconds (1 hour)
     */
    @JvmName("evcqalqqlquidioy")
    public suspend fun terminationGracePeriodSeconds(`value`: Output) {
        this.terminationGracePeriodSeconds = value
    }

    /**
     * @param value Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Maximum value is 240.
     */
    @JvmName("ygqwckmhvnuxvtvu")
    public suspend fun timeoutSeconds(`value`: Output) {
        this.timeoutSeconds = value
    }

    /**
     * @param value The type of probe.
     */
    @JvmName("wovodspjgbkqmjne")
    public suspend fun type(`value`: Output>) {
        this.type = value
    }

    /**
     * @param value Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. Maximum value is 10.
     */
    @JvmName("toooinocfyjdowbq")
    public suspend fun failureThreshold(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.failureThreshold = mapped
    }

    /**
     * @param value HTTPGet specifies the http request to perform.
     */
    @JvmName("wafdxlrvtqounwss")
    public suspend fun httpGet(`value`: ContainerAppProbeHttpGetArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.httpGet = mapped
    }

    /**
     * @param argument HTTPGet specifies the http request to perform.
     */
    @JvmName("ympqhjhwpkeyycis")
    public suspend fun httpGet(argument: suspend ContainerAppProbeHttpGetArgsBuilder.() -> Unit) {
        val toBeMapped = ContainerAppProbeHttpGetArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.httpGet = mapped
    }

    /**
     * @param value Number of seconds after the container has started before liveness probes are initiated. Minimum value is 1. Maximum value is 60.
     */
    @JvmName("eeasvuturohaemwr")
    public suspend fun initialDelaySeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.initialDelaySeconds = mapped
    }

    /**
     * @param value How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Maximum value is 240.
     */
    @JvmName("fauepdrrpughjbcq")
    public suspend fun periodSeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.periodSeconds = mapped
    }

    /**
     * @param value Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. Maximum value is 10.
     */
    @JvmName("vhxxqdpiunnfblfd")
    public suspend fun successThreshold(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.successThreshold = mapped
    }

    /**
     * @param value TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported.
     */
    @JvmName("uhntoxfemktwkafb")
    public suspend fun tcpSocket(`value`: ContainerAppProbeTcpSocketArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tcpSocket = mapped
    }

    /**
     * @param argument TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported.
     */
    @JvmName("vrmmqnpncbxtpjcc")
    public suspend fun tcpSocket(argument: suspend ContainerAppProbeTcpSocketArgsBuilder.() -> Unit) {
        val toBeMapped = ContainerAppProbeTcpSocketArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.tcpSocket = mapped
    }

    /**
     * @param value Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. Maximum value is 3600 seconds (1 hour)
     */
    @JvmName("guoinaaatljxxqmb")
    public suspend fun terminationGracePeriodSeconds(`value`: Double?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.terminationGracePeriodSeconds = mapped
    }

    /**
     * @param value Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Maximum value is 240.
     */
    @JvmName("kpvdjwyecqfowtad")
    public suspend fun timeoutSeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeoutSeconds = mapped
    }

    /**
     * @param value The type of probe.
     */
    @JvmName("hujsvlfftwmdybhy")
    public suspend fun type(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    /**
     * @param value The type of probe.
     */
    @JvmName("dneqxsotqedihybf")
    public fun type(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.type = mapped
    }

    /**
     * @param value The type of probe.
     */
    @JvmName("xsbpgnjvarexaokk")
    public fun type(`value`: Type) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.type = mapped
    }

    internal fun build(): ContainerAppProbeArgs = ContainerAppProbeArgs(
        failureThreshold = failureThreshold,
        httpGet = httpGet,
        initialDelaySeconds = initialDelaySeconds,
        periodSeconds = periodSeconds,
        successThreshold = successThreshold,
        tcpSocket = tcpSocket,
        terminationGracePeriodSeconds = terminationGracePeriodSeconds,
        timeoutSeconds = timeoutSeconds,
        type = type,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy