ec2 堆栈在重启时不更新

ec2 stack does not update on reboot

我有一个使用 cloudFormation 模板进行设置的 EC2 实例。我的 EC2 实例上有 tomcat。我正在使用我的 ec2 实例将 war 个文件部署到 tomcat。

我向 ec2 实例发布新代码的过程是:

  1. 将 war 文件部署到我的 s3 存储桶中。
  2. 更新我的 CloudFormation 模板参数以使用新的 war 文件名。然后在 CloudFormation 模板中使用此参数从 s3 存储桶中选取新的 war 文件。
  3. 在 CloudFormation 控制台中,我点击更新堆栈。
  4. 然后使用 ec2 控制台重新启动机器。

我发现当我重新启动 ec2 实例时,它不会再次部署新的 war 文件和 运行 模板。相反,我必须停止该实例,然后再次启动该实例(这非常慢)。

我认为重启实例就足够了。是我错了还是我配置不正确?

问候

许多 Clo​​udFormation 功能仅在实例为 "replaced" 时更新,请在文档中查找您用于从 s3 安装文件的类型

在属性下会显示 "Update requires",然后是 "some interruption" 或 "replacement"

等条件

s3 文件安装需要由具有 "update requires" 条件 "no interruption" 的类型 属性 控制,然后更改将在您更改 cloudformation 模板后立即发生