We have a lambda function we want to use to remove systems from our monitoring system when they are being terminated due to AutoScaling lifecycle events. The function works as expected when we run it manually but we do not see it being called when an instance is terminated. We've setup the following cloudwatch event with a target of the lambda function. We've been testing manually by scaling down an ASG and the instances terminate but the function is never called. Does anyone know what we're missing or where to look for logs of the issue.
{
"source": [
"aws.autoscaling"
],
"detail-type": [
"EC2 Instance-terminate Lifecycle Action"
],
"detail": {
"AutoScalingGroupName": [
"ASG_NAME"
]
}
}