AWS Lambda 在同一 VPC 上访问 Neptune

问题描述

我有以下 lambda 代码来尝试从 AWS 上的同一 VPC 访问 Neptune。从https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-python.html复制最多。

但我收到 403 Forbidden 错误

代码

from gremlin_python import statics
from gremlin_python.structure.graph import Graph
from gremlin_python.process.graph_traversal import __
from gremlin_python.process.strategies import *
from gremlin_python.process.traversal import T
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection

wss = 'wss://{}:{}/gremlin'.format(host,port)
remoteConn = DriverRemoteConnection(wss,'g')
print("wss--> {}".format(wss))

# grapch
graph = Graph()
g = graph.traversal().withRemote(remoteConn)

# get
info = g.V().hasLabel('my').outE().inV().path().toList()
print(info)
return info

错误回溯:

{
  "errorMessage": "HTTP 403: Forbidden","errorType": "HTTPClientError","stackTrace": [
    "  File \"/var/task/gremlin_python/process/traversal.py\",line 58,in toList\n    return list(iter(self))\n","  File \"/var/task/gremlin_python/process/traversal.py\",line 48,in __next__\n    self.traversal_strategies.apply_strategies(self)\n",line 573,in apply_strategies\n    traversal_strategy.apply(traversal)\n","  File \"/var/task/gremlin_python/driver/remote_connection.py\",line 149,in apply\n    remote_traversal = self.remote_connection.submit(traversal.bytecode)\n","  File \"/var/task/gremlin_python/driver/driver_remote_connection.py\",line 56,in submit\n    result_set = self._client.submit(bytecode,request_options=self._extract_request_options(bytecode))\n","  File \"/var/task/gremlin_python/driver/client.py\",line 127,in submit\n    return self.submitAsync(message,bindings=bindings,request_options=request_options).result()\n",line 148,in submitAsync\n    return conn.write(message)\n","  File \"/var/task/gremlin_python/driver/connection.py\",line 55,in write\n    self.connect()\n",line 45,in connect\n    self._transport.connect(self._url,self._headers)\n","  File \"/var/task/gremlin_python/driver/tornado/transport.py\",line 40,in connect\n    self._ws = self._loop.run_sync(\n","  File \"/var/task/tornado/ioloop.py\",line 576,in run_sync\n    return future_cell[0].result()\n"
  ]

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...