Posts in Category: AWS

AWS SAM CLI “ClassNotFoundException”

Intro

Again, I’ve run into an issue that took me forever to figure out and I couldn’t find a fix online so I’m just using this post to 1) store away the fix for myself in case I run into it again down the road and 2) Help anyone else who may have the same issue.

Debugging a Lambda with VSCode

Writing code for the cloud is great! So many positives that it just makes sense. The biggest downside with some is debugging your code….it gets tricky making a change, deploy, test then dig through your logs. Of course this can be automated but still get tiresome. With AWS enhancing their SAM (Serverless Application Model), it is now possible to actually run your lambdas locally within a docker container and have your IDE’s debugger attach. There are plenty of tools/plugins to utilize this (Eclipse, IntelliJ, Visual Studio…full list here) but I’m a big fan of Visual Studio Code. So let’s take a deeper dive in how to debug our java lambda line by line with VSCode!