How to alert Cloudwatch to Lambda when Ec2 is not in the preferred AZ

Hi
Is there a metric in CloudWatch where we could configure to trigger Lambda to send SNS when an instance is created in NOT preferred availability zone?

Thank you

Listen for the “pending” event (see the docs for an example event), and then do a describeInstances call against the AMI Id sent in the event payload to get availability-zone and behave accordingly.