I understand you are trying to automate importing S3 data into RDS PostgreSQL
It is recommend to use AWS Database Migration Service (DMS) to replicate changes or CDC from RDS to S3. It is better to use DMS as this solution already manages the replication activities for you. DMS uses the pglogical extension.
An alternative could be to use wal2json plugin with AWS Lambda function and Amazon Kinesis stream. This option requires more effort to build but offers much greater level of flexibility. If you are looking for least effort solution then Amazon Database Migration Service will be a better fit. For both solutions, you need to enable logical replication on RDS PostgreSQL instance.
Here is a lab which will help to understand the steps involved. 
- Accepted Answerasked 3 years ago
- Accepted Answerasked 2 years ago
- asked 2 years ago
- How do I automate the AWS DMS error log deletion process to avoid storage-full on my replication instance?AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- EXPERTpublished 8 months ago
- EXPERTpublished 3 months ago