aws / aws-lambda-base-images

Apache License 2.0
670 stars 110 forks source link

A port for debugging and stepping into the code #67

Open muhamadto opened 1 year ago

muhamadto commented 1 year ago

When running the service locally it would be helpful to step into the code. This is possible when using SAM but not when we use container images and run the function using RIE.

Can you add a debug port mapping to be used? It can be enabled and disabled via the environment variable.

For example, when running usual java apps we can add -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 to the run command and then listen to 5005 to be able to step into the code.

I have previously created a ticket in the aws-lambda-runtime-interface-emulator project. It was suggested that I reach out here instead.

niklaswallerstedt commented 1 year ago

I am interested in this as well, I use CDK with docker lambdas and most info on this is suggesting to use SAM, but I'd rather not take on another dependency.

It would be great to be able to add this to the base image or pointers on how to set this up yourself.

andrewvmail commented 1 year ago

you can add into environment variable

NODE_OPTIONS='--inspect-brk=0.0.0.0:9229'