Aurora Postgres Source Setup Guide
Supported Postgres versions
ClickPipes supports Aurora PostgreSQL-Compatible Edition version 12 and later.
Enable Logical Replication
You can skip this section if your Aurora instance already has the following settings configured:
rds.logical_replication = 1
wal_sender_timeout = 0
These settings are typically pre-configured if you previously used another data replication tool.
If not already configured, follow these steps:
- Create a new parameter group for your Aurora PostgreSQL version with the required settings:
- Set
rds.logical_replication
to 1 - Set
wal_sender_timeout
to 0
- Set
- Apply the new parameter group to your Aurora PostgreSQL cluster
- Reboot your Aurora cluster to apply the changes
Configure Database User
Connect to your Aurora PostgreSQL writer instance as an admin user and execute the following commands:
-
Create a dedicated user for ClickPipes:
-
Grant schema permissions. The following example shows permissions for the
public
schema. Repeat these commands for each schema you want to replicate: -
Grant replication privileges:
-
Create a publication for replication:
Configure Network Access
IP-based Access Control
If you want to restrict traffic to your Aurora cluster, please add the documented static NAT IPs to the Inbound rules
of your Aurora security group.
Private Access via AWS PrivateLink
To connect to your Aurora cluster through a private network, you can use AWS PrivateLink. Follow our AWS PrivateLink setup guide for ClickPipes to set up the connection.
Aurora-Specific Considerations
When setting up ClickPipes with Aurora PostgreSQL, keep these considerations in mind:
-
Connection Endpoint: Always connect to the writer endpoint of your Aurora cluster, as logical replication requires write access to create replication slots and must connect to the primary instance.
-
Failover Handling: In the event of a failover, Aurora will automatically promote a reader to be the new writer. ClickPipes will detect the disconnection and attempt to reconnect to the writer endpoint, which will now point to the new primary instance.
-
Global Database: If you're using Aurora Global Database, you should connect to the primary region's writer endpoint, as cross-region replication already handles data movement between regions.
-
Storage Considerations: Aurora's storage layer is shared across all instances in a cluster, which can provide better performance for logical replication compared to standard RDS.
Dealing with Dynamic Cluster Endpoints
While Aurora provides stable endpoints that automatically route to the appropriate instance, here are some additional approaches for ensuring consistent connectivity:
-
For high-availability setups, configure your application to use the Aurora writer endpoint, which automatically points to the current primary instance.
-
If using cross-region replication, consider setting up separate ClickPipes for each region to reduce latency and improve fault tolerance.
What's next?
You can now create your ClickPipe and start ingesting data from your Aurora PostgreSQL cluster into ClickHouse Cloud. Make sure to note down the connection details you used while setting up your Aurora PostgreSQL cluster as you will need them during the ClickPipe creation process.