![JAR search and dependency download from the Maven repository](/logo.png)
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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy