AWS/EB 上不可变部署的限制

Limitations of Immutable Deployments on AWS/EB

我试图了解 AWS/Elastic Beanstalk 上不可变部署的缺点。文档是这样说的:

You can't perform an immutable update in concert with resource configuration changes. For example, you can't change settings that require instance replacement while also updating other settings, or perform an immutable deployment with configuration files that change configuration settings or additional resources in your source code. If you attempt to change resource settings (for example, load balancer settings) and concurrently perform an immutable update, Elastic Beanstalk returns an error.

(来源:https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environmentmgmt-updates-immutable.html

但是,我无法想出一个会失败的实际场景。我使用 CloudFormation 模板进行所有配置。以上是否可以解释为我无法同时部署 CloudFormation 更改以及对应用程序 (.jar) 的更改?

非常感谢您的澄清。

对此持保留态度,因为这只是基于阅读文档的猜测;我认为基本支持是每月 40 美元,问他们确定是个好问题。

Can the above be interpreted that I cannot deploy CloudFormation changes as well as changes to the application (.jar) at the same time

我假设您使用与 CloudFormation 模板不同的流程部署应用程序 .jar。这意味着当您部署源代码时不使用 CloudFormation,您可能会使用 CI/CD 工具,例如码船。当您更改 CloudFormation 模板时,您可以登录 AWS 控制台并在那里更新模板(或使用 AWS CLI 工具)。

同时更改两者,我认为,符合他们在这里所说的内容。不要出于明显的原因这样做;您不希望 CloudFormation 在 EB 关闭该实例并启动新实例的同时尝试更改该实例。但一个更常见的例子是我认为如果您碰巧使用 .ebextensions 进行某些配置设置。

.ebextensions 是一种在 EB 中配置 CloudFormation 不能真正做到或轻易做到的事情的方法。它们是与源代码一起部署在项目根目录下名为 /.ebextensions 的文件夹中的配置文件。一个例子是改变一些特定的 linux 设置 https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html

您不想同时更改您的应用程序代码和 .ebextension。这只是我在阅读文档时的猜测,你可以很容易地测试它。