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

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

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

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

import com.pulumi.awsnative.ecs.inputs.TaskDefinitionRestartPolicyArgs.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.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * You can enable a restart policy for each container defined in your task definition, to overcome transient failures faster and maintain task availability. When you enable a restart policy for a container, Amazon ECS can restart the container if it exits, without needing to replace the task. For more information, see [Restart individual containers in Amazon ECS tasks with container restart policies](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-restart-policy.html) in the *Amazon Elastic Container Service Developer Guide*.
 * @property enabled Specifies whether a restart policy is enabled for the container.
 * @property ignoredExitCodes A list of exit codes that Amazon ECS will ignore and not attempt a restart on. You can specify a maximum of 50 container exit codes. By default, Amazon ECS does not ignore any exit codes.
 * @property restartAttemptPeriod A period of time (in seconds) that the container must run for before a restart can be attempted. A container can be restarted only once every ``restartAttemptPeriod`` seconds. If a container isn't able to run for this time period and exits early, it will not be restarted. You can set a minimum ``restartAttemptPeriod`` of 60 seconds and a maximum ``restartAttemptPeriod`` of 1800 seconds. By default, a container must run for 300 seconds before it can be restarted.
 */
public data class TaskDefinitionRestartPolicyArgs(
    public val enabled: Output? = null,
    public val ignoredExitCodes: Output>? = null,
    public val restartAttemptPeriod: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.ecs.inputs.TaskDefinitionRestartPolicyArgs =
        com.pulumi.awsnative.ecs.inputs.TaskDefinitionRestartPolicyArgs.builder()
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .ignoredExitCodes(ignoredExitCodes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .restartAttemptPeriod(restartAttemptPeriod?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [TaskDefinitionRestartPolicyArgs].
 */
@PulumiTagMarker
public class TaskDefinitionRestartPolicyArgsBuilder internal constructor() {
    private var enabled: Output? = null

    private var ignoredExitCodes: Output>? = null

    private var restartAttemptPeriod: Output? = null

    /**
     * @param value Specifies whether a restart policy is enabled for the container.
     */
    @JvmName("fajidxdaxpjkvfut")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value A list of exit codes that Amazon ECS will ignore and not attempt a restart on. You can specify a maximum of 50 container exit codes. By default, Amazon ECS does not ignore any exit codes.
     */
    @JvmName("oxylmjurwifjamlq")
    public suspend fun ignoredExitCodes(`value`: Output>) {
        this.ignoredExitCodes = value
    }

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

    /**
     * @param values A list of exit codes that Amazon ECS will ignore and not attempt a restart on. You can specify a maximum of 50 container exit codes. By default, Amazon ECS does not ignore any exit codes.
     */
    @JvmName("viuerjhxgoyunmjw")
    public suspend fun ignoredExitCodes(values: List>) {
        this.ignoredExitCodes = Output.all(values)
    }

    /**
     * @param value A period of time (in seconds) that the container must run for before a restart can be attempted. A container can be restarted only once every ``restartAttemptPeriod`` seconds. If a container isn't able to run for this time period and exits early, it will not be restarted. You can set a minimum ``restartAttemptPeriod`` of 60 seconds and a maximum ``restartAttemptPeriod`` of 1800 seconds. By default, a container must run for 300 seconds before it can be restarted.
     */
    @JvmName("aeoewmsgdmcophfl")
    public suspend fun restartAttemptPeriod(`value`: Output) {
        this.restartAttemptPeriod = value
    }

    /**
     * @param value Specifies whether a restart policy is enabled for the container.
     */
    @JvmName("aijtapknvxjyeumd")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value A list of exit codes that Amazon ECS will ignore and not attempt a restart on. You can specify a maximum of 50 container exit codes. By default, Amazon ECS does not ignore any exit codes.
     */
    @JvmName("uomwvcofdjfhxews")
    public suspend fun ignoredExitCodes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ignoredExitCodes = mapped
    }

    /**
     * @param values A list of exit codes that Amazon ECS will ignore and not attempt a restart on. You can specify a maximum of 50 container exit codes. By default, Amazon ECS does not ignore any exit codes.
     */
    @JvmName("dmslpdexhssedoqy")
    public suspend fun ignoredExitCodes(vararg values: Int) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ignoredExitCodes = mapped
    }

    /**
     * @param value A period of time (in seconds) that the container must run for before a restart can be attempted. A container can be restarted only once every ``restartAttemptPeriod`` seconds. If a container isn't able to run for this time period and exits early, it will not be restarted. You can set a minimum ``restartAttemptPeriod`` of 60 seconds and a maximum ``restartAttemptPeriod`` of 1800 seconds. By default, a container must run for 300 seconds before it can be restarted.
     */
    @JvmName("jqoaobxcwtdnyvjl")
    public suspend fun restartAttemptPeriod(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.restartAttemptPeriod = mapped
    }

    internal fun build(): TaskDefinitionRestartPolicyArgs = TaskDefinitionRestartPolicyArgs(
        enabled = enabled,
        ignoredExitCodes = ignoredExitCodes,
        restartAttemptPeriod = restartAttemptPeriod,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy