AWS SAM local invocation of lambda to access AWS Neptune over VPC

0

I need to be able to invoke a lambda locally which accesses AWS Neptune. I have setup SSH local forwarding via an EC2. How do I make this work inside lambda with sam local invoke?

Vivek
質問済み 2年前433ビュー
1回答
0
承認された回答

The solution here may depend on what OS you're using for your desktop and where you are running the SAM CLI. Docker behaves a bit differently in each OS. Running on MacOS, I can reach the SSH tunnel if I use 'wss://docker.for.mac.localhost:8182/gremlin' as my Neptune endpoint (just change gremlin to oc or sparql for the other languages). I believe this also works with host.docker.internal as a more generic host name that forwards back to localhost on your desktop OS.

The other thing you'll need to consider is SSL verification. Neptune no longer allows you to disable SSL on the cluster side. If you're just doing this for test/development, you can ignore SSL verification. For Gremlin specifically, you can do this by adding a verify_ssl=False parameter when creating the DriverRemoteConnection:

conn = DriverRemoteConnection(neptune_endpoint, 'g', pool_size=1, message_serializer=serializer.GraphSONSerializersV2d0(), verify_ssl=False)
g = traversal().withRemote(conn)
profile pictureAWS
回答済み 2年前
  • Thank you so much Taylor! That verify_ssl flag was super useful.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ