I have both application and network load balancer. EC2 instance and the Neptune are in the same VPC group. I am able to access the EC2 instance by using ssh username@ and can access the Gremlin server there and execute queries but how can I make a tunnel out of it so that I can use it from the local environment? Let me know if you need more detail.
Asked
Active
Viewed 893 times
0

Stanislav Kralin
- 11,070
- 4
- 35
- 58
-
Do a web search for "SSH port forwarding". – John Rotenstein Sep 03 '21 at 09:59
1 Answers
2
It's not 100% clear if you are connecting directly to EC2 or whether there is a NLB or an ALB in between. If you are connecting from a local machine via SSH directly to EC2 to build a tunnel to Neptune, a command such as this will work.
ssh -i mycreds.pem ec2-user@ec2-xx-xx-xx-xx.compute-1.amazonaws.com -N -L 8182:my-neptune-cluster.us-east-1.neptune.amazonaws.com:818
In order to get the SSL credentials to resolve you will likely need to add a line to your hosts
file along the lines of:
127.0.0.1 localhost my-neptune-cluster.us-east-1.neptune.amazonaws.com

Kelvin Lawrence
- 14,674
- 2
- 16
- 38
-
Thank you for response , I have done that with the similiar kind of approach. Do we really need to modify the host file as I am able to connect to that without changing the host file ? – Saurabh kr. Gupta Sep 04 '21 at 11:04
-
If the Neptune cluster has SSL enabled (the default) in many cases I have found editing the hosts file necessary. – Kelvin Lawrence Sep 04 '21 at 11:29