Is it possible to create RDS replica in public subnet while master db is in private?

0

Is it possible to create RDS replica in public subnet while master db is in private? It seems this might be possible if we create replica in different region as getting error DbSubnetGroupName should not be specified for read replicas that are created in the same region as the master

y0zg
asked 2 years ago2022 views
2 Answers
1

As long as subnets are part of the same DB Subnet group all can be done

see documentation below of creating read replicas[1]https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html

answered 2 years ago
  • I create the config via terraform and it seems the only option worked for me is to use cross-region replicaion due to this error DbSubnetGroupName should not be specified for read replicas that are created in the same region as the master I tried to create separate DB Subnet group with public subnets but in that case creation of read-replica in the same region doesn't work

0

Ideally you would have a private subnet for primary RDS instance, hence the replica would use the same subnet group and would not be accessible publicly. You cannot place the replica in a different subnet group. If your subnets are public, but primary DB has Publicly Accessibility set to No to ensure it can only connect privately, then you can have a public replica with Public Accessibility as Yes. I wouldn't recommend making the subnets public here. Here are some approaches:

  1. Setup manual replication to an RDS instance which will be public, and use that for reading purposes
  2. Use AWS DMS to move data and changes similar to 2 instead of manual replication setup
  3. Use cross region replica(might not fit the use case) within a subnet group which has public subnets in another region
AWS
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions