How to stop a particular aws AMI to NOT be triggered by Lambda

Hi All
Below is my lines of code, I would like to Stop a particular AMI from being notified/triggered by CloudWatch, as you can see I’m trying to configure Lambda that if the ec2 instance is created up the required AMI, then stop, else, please proceed to SNS to notify me. Lambda says that I’ve received key error at "event[‘detail’][‘instance-id’] which I have verified that should be ok.

Any suggestion or help is greatly appreciated.