[英]How to create EC2 AMI with Cloud Formation only before deleting that Cloud Formation stack?
My question here is I will be creating the EC2 instance using the cloud formation template, while deleting the stack I want to create the AMI of that EC2.我的问题是我将使用云形成模板创建 EC2 实例,同时删除我想要创建该 EC2 的 AMI 的堆栈。 I found some articles about how to create the AMI using the Cloud Formation template.
我找到了一些关于如何使用 Cloud Formation 模板创建 AMI 的文章。 But before deleting the stack How can I send signal to Cloud Formation to create AMI before deleting that EC2 instance.
但是在删除堆栈之前如何在删除该 EC2 实例之前向 Cloud Formation 发送信号以创建 AMI。 For RDS, EBS volumes and some others have Deletion policy, where we can specify Retain or snapshot to leave the resource to be deleted or create snapshot of that respectively.
对于 RDS、EBS 卷和其他一些有删除策略,我们可以在其中指定 Retain 或快照以保留要删除的资源或分别为其创建快照。 Can someone help with this or you if you find some article point me to that direction.
如果您找到一些文章指向我的方向,有人可以帮助您或您吗?
Thank you.谢谢你。
You need a custom resource which responds to the following events:您需要一个响应以下事件的自定义资源:
Supports the Create, Read, Update, Delete , and List (CRUDL) operations
支持创建、读取、更新、删除和列表 (CRUDL) 操作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.