How can I debug a java application deployed in EC2 instance from my Intellij, knowing that I have to use a jump server to connect the EC2 instance with SSH ??
rainman
asked Apr 12 at 2:27
-
stackoverflow.com/questions/66011833/… please check this post0xn0b174– 0xn0b1742025年04月12日 02:33:23 +00:00Commented Apr 12 at 2:33
1 Answer 1
Add the debug to your agent to your java program or server
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -jar your-app.jar
Use the below command to port forward using your bastion host
ssh -i ~/.ssh/remote.pem -o "ProxyCommand ssh -i jumpboxkey.pem -W %h:%p ec2-user@<bastion-public-ip>" ec2-user@<private-ec2-ip> -L 5005:localhost:5005
Connect Intellij
Also there is a more secured approach to do the same using SSM port forwarding check the below article
Explore related questions
See similar questions with these tags.