aws-samples / ecs-cid-sample

In this code provided with the blog, we will demonstrate how to use the draining state to update the AMI used by EC2 instances in your cluster by updating the launch configuration of your auto-scaling group. The process also ensures that the EC2 instances get the tasks drained the tasks launch on new container instance before termination occurs.
Apache License 2.0
103 stars 76 forks source link

Log the raw event before trying to access it's contents #12

Open jethrocarr opened 7 years ago

jethrocarr commented 7 years ago

This commit fixes an issue where if the Lambda is sent an invalid message that misses any of the expected fields (Eg "EC2InstanceId"), the Lambda will throw a KeyError but fail before outputting the raw message making it very difficult to figure out what was missed.