Terraform and AWS instance auto-recovery

I have helped out a few people with this exact issue: auto-recovery of an AWS instance so figured it was time to share just how easy this is to set up.

Why is this useful?

  1. DNS server
  2. syslog server
  3. legacy application

By default I suggest everything be ephemeral and not to use this except for very specific case(s).

But if you have a need then it really is this easy.. A complete example is below if you wish to test it out.