- Newest
- Most votes
- Most comments
The error you're encountering is related to IAM roles referenced within your Redshift database objects that were carried over from the production snapshot. When you restore a snapshot from one account to another, any database objects (like tables, views, or stored procedures) that reference IAM roles from the source account will still contain those references, but they won't work in the destination account.
This specific error occurs because some database objects in your restored database are trying to use the IAM role "prod-glue-datalake-role" from your production account, but that role doesn't exist in your development account. As the error states, "Role needs to be owned by the same account with cluster."
To resolve this issue, you need to:
-
Identify which database objects are referencing the production IAM role. These could be external schemas, stored procedures, or other objects that were created with references to the production role.
-
Create an equivalent IAM role in your development account with similar permissions to what the production role had.
-
Update the database objects in your development Redshift to use the new development account role instead of the production role.
For external schemas specifically, you would use an ALTER SCHEMA command to update the role. For other objects, you might need to recreate them with the correct role references.
When restoring a snapshot across accounts, you need to ensure that any IAM roles referenced by database objects are recreated in the destination account with appropriate permissions, and then update the database objects to use these new roles.
Sources
Sharing a snapshot - Amazon Redshift
Using identity-based policies (IAM policies) for Amazon Redshift - Amazon Redshift
answered a year ago
Relevant content
asked 4 years ago
- AWS OFFICIALUpdated 3 years ago
