-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ecs: support container definition's restart policy #31127
ecs: support container definition's restart policy #31127
Comments
@tmokmss Good morning. Thanks for opening the feature request. I'm unsure if restart policy is a new feature supported by Docker containers. The CloudFormationSchema::aws-ecs-taskdefinition.json and AWS::ECS::TaskDefinition ContainerDefinition doesn't appear to specify support for Restart policy. So looks like CloudFormation is yet to add support for I will open a ticket with CloudFormation team for their inputs. Thanks, |
Internal tracking ticket: P148765181 |
Per CloudFormation support, this feature is not available in CFN yet. Opened a new issue aws-cloudformation/cloudformation-coverage-roadmap#2109 in CloudFormation coverage roadmap. |
Hello, this feature is now available in Cloudformation, can it now be added to CDK? |
@sparrc The CFN spec aws-ecs-taskdefinition.json is not yet updated with the specification where |
Looks like you guys implemented it: CDK-docs |
@MartinKvL Glad it works for you now. Thanks. |
Comments on closed issues and PRs are hard for our team to see. |
### Issue # (if applicable) Closes #31127 #31425. ### Reason for this change A restart policy can be specified in CloudFormation, but not in L2. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-restart-policy.html ### Description of changes Add `enableRestartPolicy` and some properties to the container definition. ### Description of how you validated changes unit tests and integ tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the feature
Amazon Elastic Container Services (Amazon ECS) now improves container resiliency by giving you the ability to define a flexible container restart policy for restarting individual containers locally, without requiring a full task relaunch. With local container restarts, Amazon ECS can recover your containers from unexpected failures within a few seconds, enhancing your overall task stability by avoiding unnecessary task relaunches.
https://aws.amazon.com/about-aws/whats-new/2024/08/amazon-ecs-restart-containers-task-relaunch/
Use Case
automated container restarts in-place to recover your containers from transient failures such as network disruption or cases where your containers stop unexpectedly
Proposed Solution
Restart policy configuration is added to container definition in task definition. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_restart_policy
Apparently CFn still does not support it yet though. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html Maybe they are just updating docs?
Other Information
No response
Acknowledgements
CDK version used
2.152.0
Environment details (OS name and version, etc.)
macOS
The text was updated successfully, but these errors were encountered: