AWS Lambda lets you write a ‘function as a service’, and run code from 100ms to 5 minutes in execution time without maintaining any servers. This code has few limitations, but one of the issues I’ve always encountered is debugging lambda functions.
I mentioned it at a past meetup and encountered the following solutions:
- Plain old print statement debugging to cloudwatch logs. Sometimes the simplest option is the best.
- Using samlocal, which replicates the AWS Lambda runtime environment locally.
- Leveraging Cloud9, the newly released AWS code editor in the cloud
- Using X-ray to trace and inspect code in Lambda.
I think the right debugging option depends on the complexity of your code and the urgency of the situation, but could see using all of these at different times.
Bonus: here’s a post on how to continuously deploy your lambda functions.