mercredi 21 janvier 2015

Upgrading Instances in cloudformation stack with attached volumes

For the sake of this discussion, I have a very simple cloudformation setup with 1 EC2 instance that has a volume attached to it. For the sake of data retention, the volume is not part of the stack, so that even when I destroy and rebuild the complete stack, the data would not be destroyed.


My problem is that when I create a new ami as a base image for my EC2 instance and upgrade my stack to roll out the new image, I get am understandable conflict.


The way that EC2 upgrades instances is that it creates the new one, then deletes the old one. But since the cloudformation script declares that the volume should be attached to the instance, the upgrade process fails on creating the upgraded instance, due to the volume not being available.


What is the best way to retain data between image upgrades? I've been searching for the right solution for days now, but with no luck. It would seem that there are many dodgy solutions out there where people are happy with manual tasks in the rollout/upgrade process. I would like to avoid all human errors by being able to fully automate the infrastructure.





Aucun commentaire:

Enregistrer un commentaire