Invoking Lambda functions from Aurora PostgreSQL fails

0

Hi all,

This is something that was working months ago, but suddenly is not working anymore. When invoking a Lambda from the database either using SELECT * FROM aws_lambda.invoke(<function_arn>, '{"body": "Hello from Postgres!"}'::json); or SELECT * from aws_lambda.invoke(aws_commons.create_lambda_function_arn(<function_arn>), '{"body": "Hello from Postgres!"}'::json);

it fails with the message: SQL Error [XX000]: ERROR: unable to access credentials stored with the database instance

The DB cluster and function are in the same account and region. We have checked the cluster permissions and role that it has access, according to https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/PostgreSQL-Lambda.html, but we haven't figured yet what's wrong.

Does anyone have any recommendation on where to find a more detailed error message, or what else could help us solve the issue? Thanks.

EDIT: the team has now successfully configured a new role and policy according to the directions on the web page, and attached it to the cluster instead of the previous role, and it just worked with the same permissions as before. I believe somehow the database was not refreshing what we were doing, or there is some other internal bug in Aurora that was preventing the correct role assumption.

1 回答
0

Hello.

Will the error be resolved if I restart RDS?

profile picture
专家
已回答 8 个月前
  • Hi Riku, thanks for your comment. What I had tested (and it didn't work) was a reboot of the single instance in the cluster. As mentioned in the original post (EDIT), the issue was temporarily solved with a new role.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容