I have previously had an issue with machines staying running and making large bills. To avoid this I setup a CloudWatch Alarm that if the ec2 instance had less than 10% CPU utilization for 5 data points in 25 mins it would shut down. That seemed to work for a couple of months, but this month when I signed on I saw an instance that should have been shutdown still running. This also is projecting to go over my budget but didn't alarm there as it hasn't actually gone over yet :)
I checked the logs in case I had blocked it somehow but this is the history event:
Summary
Successfully executed action arn:aws:swf:ap-southeast-2:86607xxxxxxxx:action/actions/AWS_EC2.InstanceId.Stop/1.0
Data
{
"alarmName": "awsec2-i-xxxxxxxxxxxxx-LessThanThreshold-CPUUtilization",
"alarmType": "MetricAlarm",
"timestamp": "2022-10-19T23:39:12.488Z",
"historyItemType": "Action",
"historySummary": "Stop EC2 Instance 'i-xxxxxxxxxxxx' action completed successfully",
"historyData": {
"actionState": "Succeeded",
"stateUpdateTimestamp": 1666222752019,
"notificationResource": "arn:aws:swf:ap-southeast-2:86607xxxxxxxxx:action/actions/AWS_EC2.InstanceId.Stop/1.0",
"publishedMessage": null,
"error": null
}
}
Is there something I may have done to stop the event from actually shutting the machine down? I was confident it had worked as it kicked me off while I was using it.
Thanks!