We have EC2 instances that are EBS based, and they contain state (not critical state, but they have ElasticSearch indexes, Redis, and so on).
So our desire is, if it fails, have a new instance to replace it as similar as possible (this means using the most recent snapshot backup of that EBS root volume).
If we were to do it manually, we would have to do this not-so-straightforward procedure:
Create a new volume based on the latest snapshot of the EBS root volume;
Launch a new instance;
Detach the new instance root volume;
Attach the volume created in step 1 as root volume for the new instance;
Alternatively, we think we could create an image (AMI) based on the latest snapshot, and launch an EC2 instance directly using that AMI, in which case it would be a 2 step solution. Is that assumption correct?
But, even if we do that way, as far as we know it can't be automated, since even if we use Load Balancer with Auto Scaling Group, the launch template can't be set to automatically choose the 'most recent' snapshot for the new instance root volume.
What would be the best practice for this scenario, given the requirements of automatically launching a new instance as similar as possible as the current one that is running if it fails?