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

com.pulumi.awsnative.ecs.kotlin.inputs.TaskDefinitionHealthCheckArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.ecs.kotlin.inputs

import com.pulumi.awsnative.ecs.inputs.TaskDefinitionHealthCheckArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * The ``HealthCheck`` property specifies an object representing a container health check. Health check parameters that are specified in a container definition override any Docker health checks that exist in the container image (such as those specified in a parent image or from the image's Dockerfile). This configuration maps to the ``HEALTHCHECK`` parameter of docker run.
 *   The Amazon ECS container agent only monitors and reports on the health checks specified in the task definition. Amazon ECS does not monitor Docker health checks that are embedded in a container image and not specified in the container definition. Health check parameters that are specified in a container definition override any Docker health checks that exist in the container image.
 *   If a task is run manually, and not as part of a service, the task will continue its lifecycle regardless of its health status. For tasks that are part of a service, if the task reports as unhealthy then the task will be stopped and the service scheduler will replace it.
 *  The following are notes about container health check support:
 *   +  Container health checks require version 1.17.0 or greater of the Amazon ECS container agent. For more information, see [Updating the Amazon ECS Container Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html).
 *   +  Container health checks are supported for Fargate tasks if you are using platform version 1.1.0 or greater. For more information, see [Platform Versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
 *   +  Container health checks are not supported for tasks that are part of a service that is configured to use a Classic Load Balancer.
 * @property command A string array representing the command that the container runs to determine if it is healthy. The string array must start with ``CMD`` to run the command arguments directly, or ``CMD-SHELL`` to run the command with the container's default shell.
 *   When you use the AWS Management Console JSON panel, the CLIlong, or the APIs, enclose the list of commands in double quotes and brackets.
 *   ``[ "CMD-SHELL", "curl -f http://localhost/ || exit 1" ]``
 *  You don't include the double quotes and brackets when you use the AWS Management Console.
 *   ``CMD-SHELL, curl -f http://localhost/ || exit 1``
 *  An exit code of 0 indicates success, and non-zero exit code indicates failure. For more information, see ``HealthCheck`` in tthe docker container create command
 * @property interval The time period in seconds between each health check execution. You may specify between 5 and 300 seconds. The default value is 30 seconds.
 * @property retries The number of times to retry a failed health check before the container is considered unhealthy. You may specify between 1 and 10 retries. The default value is 3.
 * @property startPeriod The optional grace period to provide containers time to bootstrap before failed health checks count towards the maximum number of retries. You can specify between 0 and 300 seconds. By default, the ``startPeriod`` is off.
 *   If a health check succeeds within the ``startPeriod``, then the container is considered healthy and any subsequent failures count toward the maximum number of retries.
 * @property timeout The time period in seconds to wait for a health check to succeed before it is considered a failure. You may specify between 2 and 60 seconds. The default value is 5.
 */
public data class TaskDefinitionHealthCheckArgs(
    public val command: Output>? = null,
    public val interval: Output? = null,
    public val retries: Output? = null,
    public val startPeriod: Output? = null,
    public val timeout: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.ecs.inputs.TaskDefinitionHealthCheckArgs =
        com.pulumi.awsnative.ecs.inputs.TaskDefinitionHealthCheckArgs.builder()
            .command(command?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .interval(interval?.applyValue({ args0 -> args0 }))
            .retries(retries?.applyValue({ args0 -> args0 }))
            .startPeriod(startPeriod?.applyValue({ args0 -> args0 }))
            .timeout(timeout?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [TaskDefinitionHealthCheckArgs].
 */
@PulumiTagMarker
public class TaskDefinitionHealthCheckArgsBuilder internal constructor() {
    private var command: Output>? = null

    private var interval: Output? = null

    private var retries: Output? = null

    private var startPeriod: Output? = null

    private var timeout: Output? = null

    /**
     * @param value A string array representing the command that the container runs to determine if it is healthy. The string array must start with ``CMD`` to run the command arguments directly, or ``CMD-SHELL`` to run the command with the container's default shell.
     *   When you use the AWS Management Console JSON panel, the CLIlong, or the APIs, enclose the list of commands in double quotes and brackets.
     *   ``[ "CMD-SHELL", "curl -f http://localhost/ || exit 1" ]``
     *  You don't include the double quotes and brackets when you use the AWS Management Console.
     *   ``CMD-SHELL, curl -f http://localhost/ || exit 1``
     *  An exit code of 0 indicates success, and non-zero exit code indicates failure. For more information, see ``HealthCheck`` in tthe docker container create command
     */
    @JvmName("yhxtrbbulcuspkse")
    public suspend fun command(`value`: Output>) {
        this.command = value
    }

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

    /**
     * @param values A string array representing the command that the container runs to determine if it is healthy. The string array must start with ``CMD`` to run the command arguments directly, or ``CMD-SHELL`` to run the command with the container's default shell.
     *   When you use the AWS Management Console JSON panel, the CLIlong, or the APIs, enclose the list of commands in double quotes and brackets.
     *   ``[ "CMD-SHELL", "curl -f http://localhost/ || exit 1" ]``
     *  You don't include the double quotes and brackets when you use the AWS Management Console.
     *   ``CMD-SHELL, curl -f http://localhost/ || exit 1``
     *  An exit code of 0 indicates success, and non-zero exit code indicates failure. For more information, see ``HealthCheck`` in tthe docker container create command
     */
    @JvmName("doggujimbsijpusm")
    public suspend fun command(values: List>) {
        this.command = Output.all(values)
    }

    /**
     * @param value The time period in seconds between each health check execution. You may specify between 5 and 300 seconds. The default value is 30 seconds.
     */
    @JvmName("jkhpkqmfhihejycd")
    public suspend fun interval(`value`: Output) {
        this.interval = value
    }

    /**
     * @param value The number of times to retry a failed health check before the container is considered unhealthy. You may specify between 1 and 10 retries. The default value is 3.
     */
    @JvmName("gexayyheuojbedmu")
    public suspend fun retries(`value`: Output) {
        this.retries = value
    }

    /**
     * @param value The optional grace period to provide containers time to bootstrap before failed health checks count towards the maximum number of retries. You can specify between 0 and 300 seconds. By default, the ``startPeriod`` is off.
     *   If a health check succeeds within the ``startPeriod``, then the container is considered healthy and any subsequent failures count toward the maximum number of retries.
     */
    @JvmName("acddvysorydneogk")
    public suspend fun startPeriod(`value`: Output) {
        this.startPeriod = value
    }

    /**
     * @param value The time period in seconds to wait for a health check to succeed before it is considered a failure. You may specify between 2 and 60 seconds. The default value is 5.
     */
    @JvmName("fdpdiohbdmbybecg")
    public suspend fun timeout(`value`: Output) {
        this.timeout = value
    }

    /**
     * @param value A string array representing the command that the container runs to determine if it is healthy. The string array must start with ``CMD`` to run the command arguments directly, or ``CMD-SHELL`` to run the command with the container's default shell.
     *   When you use the AWS Management Console JSON panel, the CLIlong, or the APIs, enclose the list of commands in double quotes and brackets.
     *   ``[ "CMD-SHELL", "curl -f http://localhost/ || exit 1" ]``
     *  You don't include the double quotes and brackets when you use the AWS Management Console.
     *   ``CMD-SHELL, curl -f http://localhost/ || exit 1``
     *  An exit code of 0 indicates success, and non-zero exit code indicates failure. For more information, see ``HealthCheck`` in tthe docker container create command
     */
    @JvmName("bqtyyngrshbrwvim")
    public suspend fun command(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.command = mapped
    }

    /**
     * @param values A string array representing the command that the container runs to determine if it is healthy. The string array must start with ``CMD`` to run the command arguments directly, or ``CMD-SHELL`` to run the command with the container's default shell.
     *   When you use the AWS Management Console JSON panel, the CLIlong, or the APIs, enclose the list of commands in double quotes and brackets.
     *   ``[ "CMD-SHELL", "curl -f http://localhost/ || exit 1" ]``
     *  You don't include the double quotes and brackets when you use the AWS Management Console.
     *   ``CMD-SHELL, curl -f http://localhost/ || exit 1``
     *  An exit code of 0 indicates success, and non-zero exit code indicates failure. For more information, see ``HealthCheck`` in tthe docker container create command
     */
    @JvmName("nnbnxvuvgxmhqsgk")
    public suspend fun command(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.command = mapped
    }

    /**
     * @param value The time period in seconds between each health check execution. You may specify between 5 and 300 seconds. The default value is 30 seconds.
     */
    @JvmName("aawghlkfcmsnwudl")
    public suspend fun interval(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.interval = mapped
    }

    /**
     * @param value The number of times to retry a failed health check before the container is considered unhealthy. You may specify between 1 and 10 retries. The default value is 3.
     */
    @JvmName("vdovqvlrieeysxuy")
    public suspend fun retries(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retries = mapped
    }

    /**
     * @param value The optional grace period to provide containers time to bootstrap before failed health checks count towards the maximum number of retries. You can specify between 0 and 300 seconds. By default, the ``startPeriod`` is off.
     *   If a health check succeeds within the ``startPeriod``, then the container is considered healthy and any subsequent failures count toward the maximum number of retries.
     */
    @JvmName("fdwsrtjhmgbicckw")
    public suspend fun startPeriod(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.startPeriod = mapped
    }

    /**
     * @param value The time period in seconds to wait for a health check to succeed before it is considered a failure. You may specify between 2 and 60 seconds. The default value is 5.
     */
    @JvmName("rmgnchhfxvrbaxsb")
    public suspend fun timeout(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeout = mapped
    }

    internal fun build(): TaskDefinitionHealthCheckArgs = TaskDefinitionHealthCheckArgs(
        command = command,
        interval = interval,
        retries = retries,
        startPeriod = startPeriod,
        timeout = timeout,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy