AWS RDS

Instructions for configuring PowerSync for an AWS RDS Postgres database.

Prerequisites

The instance must be publicly accessible using an IPv4 address.

Access may be restricted to specific IPs if required — see IP Filtering.

Enable Logical Replication

Set the rds.logical_replication parameter to 1 in the parameter group for the instance.

Create a PowerSync Database User

Create a PowerSync user on Postgres:

-- SQL to create powersync user
CREATE ROLE powersync_role WITH LOGIN PASSWORD 'myhighlyrandompassword';
-- Allow the role to perform replication tasks
GRANT rds_replication TO powersync_role;
-- Set up permissions for the newly created role
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO powersync_role;

For read-only access, only the SELECT privilege is required — INSERT, UPDATE and DELETE can be removed.

To restrict read access to specific tables, explicitly list allowed tables for both the SELECT privilege, and for the publication (as well as for any other publications that may exist).

Create "powersync" Publication

-- Create publication to replicate tables. Specify a subset of tables if required.
-- NOTE: this must be named "powersync" at the moment
CREATE PUBLICATION powersync FOR ALL TABLES;

Connect PowerSync to Your Database

  1. In the PowerSync dashboard project tree, click on "Create new instance":

  1. Give your instance a name, such as "AWS RDS Testing".

  2. Under the "General" tab, you can change the default cloud region from US to EU or JP if desired (more cloud regions are available, contact us if you need a different region).

  3. Under the "DB Connections" tab, click on the + icon.

  4. Now we get the connection details from RDS:

    • On the RDS instance, copy the "Endpoint".

    • Paste the endpoint in PowerSync instance 'Host' field.

    • The Username and Password is the powersync_role created above.

    • PowerSync has the AWS RDS CA certificate pre-configured — verify-full SSL mode can be used directly, without any additional configuration required.

  5. Click "Test Connection" and fix any errors:

  6. Click "Save".

  7. PowerSync deploys and configures an isolated cloud environment for you, which will take a few minutes to complete.

Troubleshooting

If you get an error such as "IPs in this range are not supported", the instance is likely not configured to be publicly accessible. A DNS lookup on the host should give a public IP, and not for example 10.x.x.x or 172.31.x.x.

Last updated