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.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南