首页 > 解决方案 > 如何将 AWS::ECS::Service 更新为 Fargate 启动类型

问题描述

我有一个当前在 ECS 中运行的应用程序,并且正在尝试升级它以使用 Fargate 启动类型。

更新我的 cloudformation 模板并尝试更新堆栈后,我收到一个错误,表明该服务已存在。

资源处理程序返回消息:“具有标识符‘redacted-app-name’的‘AWS::ECS::Service’类型的资源已经存在。” (RequestToken:50118296-f55c-11eb-a6e3-b31cdb2b43da,HandlerErrorCode:已经存在)

我假设通过向我的服务添加LaunchTypeNetworkConfiguration键,ECS 认为这是一项不同的服务。

关于如何在不删除 ECS 服务或 Cloudformation Stack 的情况下最好地前进的任何想法?我正在寻找停机时间最短的解决方案。

谢谢!

标签: amazon-web-servicesamazon-cloudformationamazon-ecs

解决方案


Sadly chancing LaunchType requires replacement of the services. So you will have downtime.

The only way around this is to do blue/green type of deployment, where you deploy new service in Fargate, and perform redirection of traffic through R53 from old service to new one.

Similarly, changes to ServiceName require replacement.


推荐阅读