Interface CfnTaskDefinition.RestartPolicyProperty
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnTaskDefinition.RestartPolicyProperty.Jsii$Proxy
- Enclosing class:
CfnTaskDefinition
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 in the Amazon Elastic Container Service Developer Guide .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ecs.*;
RestartPolicyProperty restartPolicyProperty = RestartPolicyProperty.builder()
.enabled(false)
.ignoredExitCodes(List.of(123))
.restartAttemptPeriod(123)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCfnTaskDefinition.RestartPolicyPropertystatic final classAn implementation forCfnTaskDefinition.RestartPolicyProperty -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default ObjectSpecifies whether a restart policy is enabled for the container.default ObjectA list of exit codes that Amazon ECS will ignore and not attempt a restart on.default NumberA period of time (in seconds) that the container must run for before a restart can be attempted.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getEnabled
Specifies whether a restart policy is enabled for the container.Returns union: either
BooleanorIResolvable- See Also:
-
getIgnoredExitCodes
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.
Returns union: either Listinvalid input: '<'
Number> orIResolvable- See Also:
-
getRestartAttemptPeriod
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
restartAttemptPeriodseconds. If a container isn't able to run for this time period and exits early, it will not be restarted. You can set a minimumrestartAttemptPeriodof 60 seconds and a maximumrestartAttemptPeriodof 1800 seconds. By default, a container must run for 300 seconds before it can be restarted.- See Also:
-
builder
-