I want to create a health check script to deploy on my VM, that I'll call over HTTP. After receiving the result of the script(say n number of failures) I'd want to stop and delete the VMs and then replace by some autoscaling group or create a replacement instance for the same. How should I go about achieving this?