You've not stated how you are creating these instances but if it's with auto scaling the health check will automatically terminate them and launch a new one.
- There may be an Event Bridge rule you can create to pick this up and have an action off the back of it.
- You could have an alarm created at instance launch and delete on terminate.
- Write a Lambda to run on a scheduled event to check status.
Hi - Not very sure on the use case but if you use auto scaling then one of the check is status checks. Amazon EC2 Auto Scaling uses the results of the Amazon EC2 instance status checks and system status checks to determine the health status of an instance. If the instance is in any Amazon EC2 state other than running, or if its status for the status checks becomes impaired, Amazon EC2 Auto Scaling considers the instance to be unhealthy and replaces it.
For other use cases, you can create alarms at instance launch and delete on terminate as needed.
Creating an alarm out of log group's metric filter.asked 2 years ago
Is it possible to have an alarm action get re-triggered every so often?asked 10 months ago
creating a subscription (for all notification types)asked 8 months ago
bandwidth consuptions and notificationasked a year ago
Can I get email when instance reachability check failedasked 2 years ago
Notification when ANY status check failsAccepted Answerasked a month ago
How to find deadlock process in RDS My SQL and set alarm notification？asked 6 months ago
How do I know when a new Metric value is available for a SiteWise Asset?asked 3 years ago
EC2 instance fails to fully start - fails Instance Status Checkasked 10 months ago
Any way to specify the private IP when creating an instance?asked 2 years ago