4

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 3

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

1 Comment

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.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.