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 年前檢視次數 2052 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南