Skip to content

ContainerRestartPolicy

Source code in docs_src/capo_ecs/types/container_restart_policy.py
class ContainerRestartPolicy(TypedDict, closed=True):
    enabled: "capo_ecs.types.boxed_boolean.BoxedBoolean"
    """<p>Specifies whether a restart policy is enabled for the container.</p>"""
    ignored_exit_codes: NotRequired["capo_ecs.types.integer_list.IntegerList"]
    """<p>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.</p>"""
    restart_attempt_period: NotRequired["capo_ecs.types.boxed_integer.BoxedInteger"]
    """<p>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 <code>restartAttemptPeriod</code> 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 <code>restartAttemptPeriod</code> of 60 seconds and a maximum <code>restartAttemptPeriod</code> of 1800 seconds. By default, a container must run for 300 seconds before it can be restarted.</p>"""

enabled instance-attribute

enabled: BoxedBoolean

Specifies whether a restart policy is enabled for the container.

ignored_exit_codes instance-attribute

ignored_exit_codes: NotRequired[IntegerList]

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.

restart_attempt_period instance-attribute

restart_attempt_period: NotRequired[BoxedInteger]

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.