AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
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 in the Amazon Elastic Container Service Developer Guide.
Namespace: Amazon.ECS.Model
Assembly: AWSSDK.ECS.dll
Version: 3.x.y.z
public class ContainerRestartPolicy
The ContainerRestartPolicy type exposes the following members
Name | Description | |
---|---|---|
![]() |
ContainerRestartPolicy() |
Name | Type | Description | |
---|---|---|---|
![]() |
Enabled | System.Boolean |
Gets and sets the property Enabled. Specifies whether a restart policy is enabled for the container. |
![]() |
IgnoredExitCodes | System.Collections.Generic.List<System.Int32> |
Gets and sets the 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. |
![]() |
RestartAttemptPeriod | System.Int32 |
Gets and sets the 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 |
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5