0

Is there anyway to access neptune DB(Gremlin) using lambda functions?

I want to access neptune DB(gremlin) and I don't know how to access.

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
Aye Nyein
  • 117
  • 2
  • 9
  • Add more info on what you environment is. – 0xInfection Jan 30 '19 at 01:43
  • I used AWS for the first time and I created Neptune DB instance and EC2 instance. I tested using neptune DB can access Gremlin console and i want to know, can access neptune using lambda? – Aye Nyein Jan 30 '19 at 02:10
  • Looks like you'd need to build a package that includes `gremlin`: [Using Node.js to Connect to a Neptune DB Instance - Amazon Neptune](https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-node-js.html) – John Rotenstein Jan 30 '19 at 03:04
  • For those who are still looking for a code sample to connect Lambda to AWS Neptune: https://github.com/hardikvasa/database-journal/blob/master/code-samples/aws_neptune.py – hnvasa Jun 16 '19 at 03:36

1 Answers1

3

Yes you can access Amazon Neptune from Lambda. Let's say, as an example, you wanted to use Python, as part of the ZIP file that you upload to Lambda you would need to include the Gremlin Python libraries in the ZIP file. The Lambda documentation has some good examples of how to create that ZIP file. You also need to make sure that the Lambda function has access to the VPC that Neptune is running in.

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
  • when I test my gremlin function(index.js), show this error message: Response: { "errorMessage": "Handler 'handler' missing on module 'index'" } Please let me know what am I missing – Aye Nyein Jan 31 '19 at 06:52
  • Your Lambda function needs to provide a handler method that Lambda can call. Have you seen the documentation at https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html ? Hopefully that will help. – Kelvin Lawrence Jan 31 '19 at 17:03