I have couple of instances part of ASG, these are worker ec2 instances not exposed to the public, there is a systemctl service initialized via user-data, sometimes initializing the service fails for a reason or another.
When such case happens I need a way to set the instance is unhealthy so that the ASG replaces it.
I thought if having cronjob running inside the ec2 instance or lambda function and trigger update-health-check but I think this is anti-pattern.
The custom up/down 0/1 cloudwatch matrix and an alarm based on the value to set it as healthy could be the solution, is there is any out of the box design to solve this trivial workflow?