Granted permission to the role in redshift. But when accessing through lambda, it says permission denied.

0

I've created a dedicated IAR role with all the necessary policies to access the redshift and assigned it to my lambda. And also added tags "RedshiftDbRoles". I created a role in the workbench and granted it permission to access the tables and schemas. But yet it says permission denied for the relation "/name/". I am not able to figure out why it's happening. It says this : SQL query failed: aaaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa: \n Error: ERROR: permission denied for relation "/name".

1개 답변
0

Hello.

The "permission denied" error you're encountering in Amazon Redshift when trying to access tables or schemas from a Lambda function can be caused by a variety of issues. To troubleshoot and resolve this issue, you should consider the following steps:

Check Lambda Execution Role Permissions:

Ensure that the IAM role attached to your Lambda function (the one you mentioned with the necessary policies) has the correct permissions to access Redshift. Verify that it includes the AmazonRedshiftDataFullAccess or more specific permissions for your use case.

Verify Trust Relationship:

Make sure that the trust relationship for your Lambda execution role allows Lambda to assume the role. Double-check the trust relationship policy to ensure that it specifies "Service": "lambda.amazonaws.com" as the trusted entity.

Redshift IAM Role Permissions:

Verify that the IAM role you created for Redshift (the one with the "RedshiftDbRoles" tag) has the necessary permissions to access the tables and schemas you need. It should have permissions like AmazonRedshiftReadOnlyAccess or more specific permissions depending on your requirements.

Best regards, Andrii

profile picture
전문가
답변함 8달 전

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

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

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

관련 콘텐츠