- Newest
- Most votes
- Most comments
Thank you for providing such a detailed description of your issue. It seems you're encountering permission-related problems while setting up the Firehose RDS Postgres CDC to Apache Iceberg tables feature. Let's address your concerns step by step.
-
Permissions: The error message indicates that the database user configured in your Firehose Delivery Stream lacks sufficient permissions. To resolve this, ensure that the user has the following privileges:
- REPLICATION privilege to add source tables to a publication
- CREATE privileges on the database to add publications
- SELECT privileges on the source tables for initial data copy
- INSERT and SELECT privileges on the watermark table
-
Logical Replication: The error also mentions that logical replication must be enabled on the database. This is a crucial step for CDC to work properly.
-
Publications: You're correct that publications need to be created for the tables you want to replicate. While it may seem redundant given that you specified tables in your Firehose stream definition, publications are a PostgreSQL feature necessary for logical replication. They define which tables should be replicated.
-
Transaction Logs: Enabling transaction logs is indeed necessary, as they record all database changes that Firehose needs to replicate.
To create publications for your tables, you can use SQL commands like this:
CREATE PUBLICATION publication_name FOR TABLE table1, table2, table3;
Replace 'publication_name' with a meaningful name and list all the tables you want to replicate.
As for grants, ensure you've run something like:
GRANT SELECT ON ALL TABLES IN SCHEMA public TO firehose_user; GRANT USAGE ON SCHEMA public TO firehose_user; GRANT ALL PRIVILEGES ON DATABASE your_database TO firehose_user; ALTER USER firehose_user WITH REPLICATION;
Replace 'firehose_user' with the actual user you've set up for Firehose, 'public' with your schema name if different, and 'your_database' with your actual database name.
While it may seem like an additional step to create publications, it's a necessary part of setting up logical replication in PostgreSQL. This approach allows for more granular control over what gets replicated, which can be beneficial in more complex scenarios.
Regarding using the primary RDS endpoint instead of the reader endpoint, this is typically recommended for CDC setups to ensure all changes are captured accurately.
Remember, as this feature is in preview, some aspects of the setup process might be refined in future releases to make it more streamlined.
Sources
Replicate database changes to Apache Iceberg Tables with Amazon Data Firehose - Amazon Data Firehose
[Solved] Connectivity Issues with Kinesis Firehose Preview Capability and RDS (CDC) | AWS re:Post
Prerequisites to use database as a source - Amazon Data Firehose
Relevant content
- asked 6 months ago
- asked 19 days ago
- asked 6 months ago
- asked 8 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 5 months ago