db_instance_automated_backups_replication submodule enables cross-region replication of automated backups for an RDS DB instance. It creates an aws_db_instance_automated_backups_replication resource in the destination region that continuously replicates backups from the source region.
This is distinct from a cross-region read replica: automated backups replication does not create a live standby instance — it copies backup data to the destination region so that you can restore a DB instance there in a disaster recovery scenario.
Source
Usage
This submodule must be deployed in the destination region by configuring an alternate AWS provider:main.tf
The source RDS instance must have
backup_retention_period set to 1 or greater. Automated backups replication cannot be enabled on an instance with backups disabled.Input variables
The ARN of the source DB instance whose automated backups will be replicated to this region.Default:
nullThe ARN of the KMS encryption key in the destination AWS region used to encrypt the replicated backups. If not specified, the default AWS-managed KMS key for RDS is used.Default:
nullThe number of days to retain the replicated automated backups in the destination region. Must be between
1 and 35.Default: 7A pre-signed URL containing a Signature Version 4 signed request for the
StartDBInstanceAutomatedBackupsReplication action in the source region. Required only when replicating to a region that requires an explicit pre-signed URL.Default: nullWhether to create the automated backups replication resource. Set to
false to skip creation.Default: trueRegion where this resource will be managed. Defaults to the region set in the provider configuration.Default:
nullComplete example
Theexamples/complete-postgres/ and examples/cross-region-replica-postgres/ examples show this submodule used alongside a KMS module:
main.tf
Relationship to cross-region read replicas
| Feature | Automated Backups Replication | Cross-Region Read Replica |
|---|---|---|
| What it creates | Backup copies in another region | A live RDS instance in another region |
| Source | Any RDS instance with backups enabled | An RDS instance |
| Cost | Storage cost for backup data | Full instance + storage cost |
| Restore | Must manually restore from backup | Can promote replica to primary |
| Use case | Disaster recovery (RPO) | Read scaling + DR (lower RTO) |