I have a basic question. I've written a cloudformation template to provision an EC2 instance but I would to understand how can I set up a way that the cloudformation template will be triggered when the EC2 instance is terminated. I see the AutoScaling Groups/Launch Configuration you can pass the user data to set up the instance as you want but is there a way to pass the template to create the EC2 exactly as I have defined in the CloudFormation template?
Maybe I am just confused and looking for guidance and best practice.
Thanks!