Striim 4.0.4 documentation

Table of Contents

PostgreSQL setup in Amazon Aurora with PostgreSQL compatibility

You must set up replication at the cluster level. This will require a reboot, so it should probably be performed during a maintenance window.

Amazon Aurora supports logical replication for PostgreSQL compatibility options 10.6 and later. Automated backups must be enabled. To set up logical replication, your AWS user account must have the rds_superuser role.

For additional information, see Using PostgreSQL logical replication with Aurora, Replication with Amazon Aurora PostgreSQL, and Using logical replication to replicate managed Amazon RDS for PostgreSQL and Amazon Aurora to self-managed PostgreSQL.

  1. Go to your RDS dashboard, select Parameter groups > Create parameter group.

  2. For the Parameter group family, select the aurora-postgresql item that matches your PostgreSQL compatibility option (for example, for PostgreSQL 11, select aurora-postgresql11).

  3. For Type, select DB Cluster Parameter Group.

  4. For Group Name and Description, enter aurora-logical-decoding, then click Create.

  5. Click aurora-logical-decoding.

  6. Enter logical_ in the Parameters field to filter the list, click Modify, set rds.logical_replication to 1, and click Continue > Apply changes.

  7. In the left column, click Databases, then click the name of your Aurora cluster, click Modify, scroll down to Database options (you may have to expand the Additional configuration section), change DB cluster parameter group to aurora-logical-decoding, then scroll down to the bottom and click Continue.

  8. Select Apply immediately > Modify DB instance. Wait for the cluster's status to change from Modifying to Available, then stop it, wait for the status to change from Stopping to Stopped, then start it.

  9. In PSQL, enter the following command to create the replication slot:

    SELECT pg_create_logical_replication_slot('striim_slot', 'wal2json');
  10. Create a role with the REPLICATION attribute for use by PostgreSQLReader and give it select permission on the schema(s) containing the tables to be read. Replace ****** with a strong password and (if necessary) public with the name of your schema.

    CREATE ROLE striim WITH LOGIN PASSWORD '******';
    GRANT rds_replication TO striim;
    GRANT SELECT ON ALL TABLES IN SCHEMA public TO striim;