Srinivas Varma
Srinivas Varma

Reputation: 49

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. I found some articles about how to create the AMI using the Cloud Formation template. But before deleting the stack How can I send signal to Cloud Formation to create AMI before deleting that EC2 instance. 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. Can someone help with this or you if you find some article point me to that direction.

Thank you.

Upvotes: 0

Views: 291

Answers (1)

Marcin
Marcin

Reputation: 238747

You need a custom resource which responds to the following events:

Supports the Create, Read, Update, Delete, and List (CRUDL) operations

Upvotes: 1

Related Questions