Unless there is a hard requirement for you to run the lambda in AWS for testing purposes and @luk2302 already mentioned it is quite some effort to get the networking going in the right direction.
You can actually run your lambda locally and test with your UI.
There is a lambda docker image for java
runtime published by AWS in gallery.ecr.aws
Package your code locally using the provided base image:
docker build -t <image name> .
To run your image locally:
docker run -p 9000:8080 <image name>
In a separate terminal, you can then locally invoke the function using cURL:
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"payload":"hello world!"}'
Another option would be to use LocalStack - A fully functional local AWS cloud stack
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…