设置ECS Cloudformation更新堆栈超时? [英] Set the ECS Cloudformation Update Stack timeout?

查看:88
本文介绍了设置ECS Cloudformation更新堆栈超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用新的容器映像更新Cloudformation EC2容器服务(ECS)堆栈时,是否有任何方法可以控制超时,因此如果服务不稳定,它会自动回滚吗?

When updating a Cloudformation EC2 Container Service (ECS) Stack with a new Container Image, is there any way to control the timeout so if the service does not stabilize it rolls back automatically?

由于未创建实例,属于Auto Scaling组的UpdatePolicy属性无济于事.

The UpdatePolicy attribute which is part of the Auto Scaling Group does not help since instances are not being created.

我还尝试了WaitCondition,但无法使其正常工作.

I also tried a WaitCondition but have not been able to get that to work.

堆栈实际上一直保持在UPDATE_IN_PROGRESS状态,直到达到默认超时时间(约3小时),或者您触发了取消更新.

The stack essentially just stays in the UPDATE_IN_PROGRESS state until it hits the default timeout (~3 hours), or you trigger a Cancel the update.

理想情况下,我们可以在短时间内使堆栈超时.

Ideally we would be able to have the stack timeout after a short period of time.

这是我的Cloudformation模板的样子: https://s3.amazonaws.com/aws-rga-cw-public/ops/cfn/ecs-cluster-asg-elb-cfn.yaml
谢谢.

This is what my Cloudformation template looks like: https://s3.amazonaws.com/aws-rga-cw-public/ops/cfn/ecs-cluster-asg-elb-cfn.yaml
Thanks.

推荐答案

在AWS创建允许资源转出信号的ECS UpdatePolicy和CreationPolicy之前,我已经为该问题创建了解决方法:

I've created a workaround for this problem until AWS creates a ECS UpdatePolicy and CreationPolicy that allows for resourcing signaling:

在宏中使用 AWS :: CloudFormation :: WaitCondition ,该宏将在预期服务更新时创建新的WaitCondition资源.用附加到任务的非必需容器来通知等待条件.

Use AWS::CloudFormation::WaitCondition with a Macro that will create new WaitCondition resources when the service is expected to update. Signal the wait condition with a non-essential container attached to the task.

示例: https://github.com/deuscapturus/cloudformation-macro-WaitConditionUpdate/blob/master/example-ecs-service.yaml

可以在此处找到上述示例的宏: https://github.com/deuscapturus/cloudformation-macro-WaitConditionUpdate

The Macro for the above example can be found here: https://github.com/deuscapturus/cloudformation-macro-WaitConditionUpdate

这篇关于设置ECS Cloudformation更新堆栈超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆