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
已提问 2 年前2051 查看次数
2 回答
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

已回答 2 年前
  • 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
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则