AWS EC2 AMI 可以替换为相同的 ID 吗?
Can an AWS EC2 AMI be replaced with the same ID?
是否可以在保留原始 AMI Image ID 的同时用新 AMI 替换自定义 AMI?我问这个的原因是我有各种 Cloudformation 模板可以启动自动扩展的 EC2 组。不必经历使用新的 AMI 图像 ID 更新我的 Cloudformation 模板并重新加载的过程,我只想终止 运行 实例,这将使新实例启动。如果我可以替换 AMI 并保持相同的图像 ID,这种 "terminate instances" 方法就会起作用。有什么想法吗?
无法重复使用 AMI ID。
您可以将您的 AMI ID 放在 nested stack 中。这样您只需要在一个位置更改 AMI ID。
更高级的 CloudFormation 用户利用 Custom Resources that call-out to another service to determine which AMI to use, but that's somewhat complex (example)。
是否可以在保留原始 AMI Image ID 的同时用新 AMI 替换自定义 AMI?我问这个的原因是我有各种 Cloudformation 模板可以启动自动扩展的 EC2 组。不必经历使用新的 AMI 图像 ID 更新我的 Cloudformation 模板并重新加载的过程,我只想终止 运行 实例,这将使新实例启动。如果我可以替换 AMI 并保持相同的图像 ID,这种 "terminate instances" 方法就会起作用。有什么想法吗?
无法重复使用 AMI ID。
您可以将您的 AMI ID 放在 nested stack 中。这样您只需要在一个位置更改 AMI ID。
更高级的 CloudFormation 用户利用 Custom Resources that call-out to another service to determine which AMI to use, but that's somewhat complex (example)。