moto icon indicating copy to clipboard operation
moto copied to clipboard

RDS ReadReplicaDBInstanceIdentifiers and SourceDBInstanceIdentifier show db-name for cross-region replication

Open Tmilly opened this issue 3 years ago • 1 comments

Currently in all cases, moto will use a database's name for the ReadReplicaDBInstanceIdentifiers and SourceDBInstanceIdentifier fields in the RDSBackend.

This aligns with AWS's states for same-region replication. However for cross-region replication, AWS provides full arns for ReadReplicaDBInstanceIdentifiers and SourceDBInstanceIdentifier. Moto does not reflect this behavior for cross-region replication.

Can we update this for cross-region support to ensure moto stores/uses the full arn for its DBInstanceIdentifiers?

Reproducible steps:

  1. Create a same-region replication (primary and replica in the same region) in AWS, and run a describe call on both the primary and replica. Notice both SourceDBInstanceIdentifier and ReadReplicaDBInstanceIdentifiers align with just the database name
  2. Create a cross-region replication (primary in one region, replica in a second region) in AWS, and run a describe call on both the primary and replica. Notice both SourceDBInstanceIdentifier and ReadReplicaDBInstanceIdentifiers align with just the resource's full arn.
  3. Create a cross-region replication using moto, and run a describe call on both the primary and replica. Notice both SourceDBInstanceIdentifier and ReadReplicaDBInstanceIdentifiers come back as the database name. (This does not align with AWS's behavior)

Tmilly avatar Aug 26 '22 12:08 Tmilly

Thanks for raising this @Tmilly, and welcome to Moto - marking this as a bug.

PR's are always welcome, if you'd like to tackle this!

bblommers avatar Aug 27 '22 15:08 bblommers