是否可以通过调用另一个RDS DB连接器lambda函数来lambda函数访问RDS DB?

发布于 2025-02-09 09:48:51 字数 471 浏览 0 评论 0原文

我知道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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

墨小沫ゞ 2025-02-16 09:48:51

是的,这可以做到。相同的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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文