Closed tmokmss closed 1 month ago
@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 restartPolicy
.
I will open a ticket with CloudFormation team for their inputs.
Thanks, Ashish
Internal tracking ticket: P148765181
Per CloudFormation support, this feature is not available in CFN yet. Opened a new issue https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/2109 in CloudFormation coverage roadmap.
Hello, this feature is now available in Cloudformation, can it now be added to CDK?
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 RestartPolicy
property has been supported in ContainerDefinition
. As soon as the change is available there, CDK L1 constructs should be updated shortly thereafter.
Looks like you guys implemented it: CDK-docs Thanks a lot 👏
@MartinKvL Glad it works for you now. Thanks.
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.
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