是否可以通过调用另一个RDS DB连接器lambda函数来lambda函数访问RDS DB?
我知道lambda功能既可以调用另一个lambda功能,又可以访问RDS DB。这是两个功能都包含在一个函数中的情况。
这次,我想创建管理RDS DB的Lambda A,Lambda B调用Lambda A并访问RDS DB。 (要么通过直接调用lambda函数,要么通过api url调用)
我觉得这可以做到,但找不到并提示,但看不到任何做过我案件的人。
添加了有关更具体的方案的添加
,我希望lambda a使用pymysql,返回pymysql.connect输出。 Lambda B致电Lambda A,获取Pymysql.connect,并放置其他光标并执行我想要的查询。
目前的问题是当调用lambda时,输出在JSON中,并且读取了JSON给出字节(或通过各种方法字符串)。除此之外,pymysql.connect的原始数据类型是< class'pymysql.connections.connection'>,因此它不起作用。
I know lambda function can both call another lambda function and access rds db. This is the case where both features are contained in one function.
This time, I want to create lambda A that manages accessing to rds db, and lambda B calls lambda A and access to rds db. (either by invoke lambda function directly or api url call)
I feel this can be done but couldn't find and hints but can't see anyone who have done my case.
Added
For more specific scenario, I want lambda A to connect to my rds db using pymysql, returns pymysql.connect output. Lambda B calls lambda A, get pymysql.connect and put additional cursor and execute queries that I want.
The problem at the moment is when lambda is invoked, the output is in json and reading that json gives byte (or string by various methods). Beside, the original data type for pymysql.connect is <class 'pymysql.connections.Connection'>, therefore it does not work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这可以做到。相同的AWS Lambda编程模型仍然适用。因此,您必须对Lambda功能A和B相互交流的方式进行自己的API /模型。
Yes this can be done. The same AWS Lambda programming model would still apply. So you'd have to make your own API / model of how Lambda functions A and B would communicate with each other.