是否可以使用 CodeDeploy 来使用先前部署的本地缓存修订?

Is it possible to use CodeDeploy to use locally cached revisions from a previous deployment?

我正在尝试使用 CodeDeploy 有效地为我重新启动我的服务(通过与负载均衡器的正确交互)。为此,我复制了以前的部署并重新部署。

不幸的是,作为重新部署的一部分,CodeDeploy 从 S3 存储桶重新下载包,即使内容已经在主机上。

有没有办法指示 CodeDeploy 重新下载存储桶并仅使用机器上现有的修订包?

如果没有,那么在主机上保留比最新版本更多的版本有什么好处?

Is there a way to instruct CodeDeploy to not re-download the bucket and just use the existing revision bundle on the machine?

据我所知,这是不可能的。每次 CodeDeploy 部署时,它都会创建一个 DeploymentId。这是不可变的。

If there isn't, then what is the benefit of keeping more than the most recent revision on the host machine at all?

之前的修订用于运行 ApplicationStop 生命周期挂钩脚本。除此之外,您不需要保留旧版本。 “:max_revisions:” 属性 可以在 CodeDeploy 代理配置文件 [1] 中配置,以指定要存储多少修订(默认为 5)。该值需要 >=1.

[1] https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-agent-configuration.html