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 Answer
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
EXPERT
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions