2 Answers
- Newest
- Most votes
- Most comments
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
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:
- Setup manual replication to an RDS instance which will be public, and use that for reading purposes
- Use AWS DMS to move data and changes similar to 2 instead of manual replication setup
- Use cross region replica(might not fit the use case) within a subnet group which has public subnets in another region
answered 2 years ago
Relevant content
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 6 months 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