Skip to content

How to change the owner of zero-ETL-created objects in Redshift

0

We have created a database for a zero-ETL integration from a DynamoDB table to Redshift using a certain database user. The schema and tables which contain the replication now also belong to that user. How to transfer ownership of all the objects to another user? Preferably without having to recreate the integration or database, to avoid loosing the history. I was able to alter the owner of the database but for a table I get:

alter table public."dynamodb-table" owner to new_user;
-- ERROR: Zero-ETL table can only undergo Alter Sortkey

asked a year ago269 views

1 Answer
0
Accepted Answer

In Amazon Redshift, when working with zero-ETL integrations, there are limitations on what alterations you can make to the replicated tables. As you've discovered, you cannot change the owner of a zero-ETL table directly using the ALTER TABLE command, as these tables only support ALTER SORTKEY operations.

For zero-ETL integrations, you can change the ownership at the database level using the ALTER DATABASE command with the OWNER TO clause:

ALTER DATABASE your_zero_etl_database OWNER TO new_owner;

This requires superuser privileges. You've already done this step successfully.

However, for the schema and individual tables created by the zero-ETL integration, the ownership restrictions are more strict. The tables are managed by the integration process, and their structure and ownership are controlled by the integration itself.

Unfortunately, there isn't a direct way to change the ownership of the zero-ETL tables without recreating the integration. The error message you received ("Zero-ETL table can only undergo Alter Sortkey") confirms this limitation.

If you need to grant access to these tables to other users, instead of changing ownership, consider:

  1. Creating appropriate permissions using GRANT statements to allow the new user to access the data
  2. Creating views owned by the new user that reference the zero-ETL tables
  3. Setting up appropriate role-based access control

These approaches allow you to maintain the zero-ETL integration while providing the necessary access to other users without changing the underlying table ownership.
Sources
ALTER DATABASE - Amazon Redshift
ALTER TABLE - Amazon Redshift
Encrypted Cross Account Zero-ETL integration between DynamoDB and Redshift | AWS re:Post

answered a year ago

  • Understood. My use case is that the owning user needs to be dropped.

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.