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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠