many-salesmen-89069
07/13/2021, 12:43 PMError creating DB Instance: InvalidDBInstanceState: Automated backups are not enabled for this database instance. To enable automated backups, use ModifyDBInstance to set the backup retention period to a non-zero value.
This is my code:
const replicaDbSubnets = new aws.rds.SubnetGroup("replica-db-subnets", {
subnetIds: vpc.publicSubnetIds,
});
const isolatedDbReplica = new aws.rds.Instance(`${name}-isolated-db-replica`, {
instanceClass: "db.t2.micro",
allocatedStorage: 10,
dbSubnetGroupName: replicaDbSubnets.name,
vpcSecurityGroupIds: [isolatedReplicaSg.id],
skipFinalSnapshot: true,
publiclyAccessible: true,
replicateSourceDb: isolatedDb.identifier,
backupRetentionPeriod: 0
});
My understanding is that backups should be only enabled for the source db?DbSubnetGroupName should not be specified for read replicas that are created in the same region as the master
witty-candle-66007
07/13/2021, 3:30 PMbackup_retention_period
property was added to the source DB after the DB was initially deployed but the apply_immediately
property was not set.
So the adding of a backup retention period to the source DB was scheduled for your next maintenance window. And, so the read replica was failing due to the source not yet having backups set.
Redeploying the stack avoided this since the source DB was deployed with the backups set and so then you saw the region error.many-salesmen-89069
07/13/2021, 3:44 PM