
Easier EC2 instance maintenance with managed draining for Amazon ECS capacity providers
Learn how Amazon ECS capacity providers can help you to gracefully maintain your fleet of Amazon EC2 instances without causing downtime for your application containers.
UpdatePolicy
setting to configure an infrastructure as code driven rolling replacement of your EC2 instances.SIGTERM
stop signal to each task container that needs to be stopped, and then wait for the duration of the stop timeout to see if the container gracefully exits on its own. If the container does not gracefully exit by the time the stop timeout has passed, then Amazon ECS will send a SIGKILL
signal to force stop the container’s process. If your task is doing some heavy work that you can’t complete quickly, then you can configure a longer stop timeout on the task. Managed instance draining will keep the Amazon EC2 instance in a draining status until the task gracefully exits on its own, or until the stop timeout period is exceeded and Amazon ECS force stops the task. However, while Amazon ECS stop timeout for Amazon EC2 tasks can be set to wait for years if you wish, the Amazon EC2 draining period can not exceed 48 hours. Therefore, it is not advisable to set task stop timeout to greater than 48 hours.SIGTERM
signal to stop, irrespective of their task protection status. You can use a stop timeout on the task to delay the task force quit, and hold the Amazon EC2 instance in a draining state for up to 48 hours.disableApiStop
or disableApiTermination
attributes on the Amazon EC2 instance that hosts the task. This will provide an additional layer of protection against any automated Amazon EC2 instance disrupting actions.RunTask
launched, or CreateService
launched.Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.