Please let me know if it is possible to debug Java AWS Lambda (serverless framework) in eclipse. Any pointers will be really helpful
3 Answers
I know there are some interesting bespoke solutions that are being developed for live serverless debugging if you're prepared to leave Eclipse. Rookout is one example

- 67
- 4
You'll want to take a look at AWS Sam. Basically you create a yaml file that runs your application, attach to the process, and use the Sam CLI to send events at your code.
From this github, you can see that a very simple yaml file is:
AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: A simple hello world Java 8 function
Resources:
HelloWorld:
Type: AWS::Serverless::Function
Properties:
Runtime: java8
Handler: your.package.here.YourLambdaHandler
CodeUri: ./target/your.jar

- 16,263
- 11
- 31
- 53
-
The poor/lack of documentation on AWS products never ceases to amaze me. I've been searching for an hour and all I've found is that tutorial using an app in CodeStar but nothing on how everything actually works and how to set it. – Lucas Apr 21 '20 at 15:57
I would assume you plan to debug it locally.
You need aws-sam-cli
tool where a lambda could be run locally using sam local
command.
sam local start-api -d 5858
and port 5858 will be used for debugging purposes.
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-debugging.html
Here an example how to do this with eclipse. https://docs.aws.amazon.com/toolkit-for-eclipse/v1/user-guide/tke-sam-local.html#debug-lam-function-locally

- 2,887
- 14
- 24