I use DatabaseInstanceReadReplica create replicas in same region as master
DbSubnetGroupName should not be specified for read replicas that are created in the same region as the master
my code:
avalon_mysql= rds.DatabaseInstance(
self,
"WebGMRds",
master_username='admin',
master_user_password=core.SecretValue('Welcome1#'),
engine=rds.DatabaseInstanceEngine.MYSQL,
vpc=default_vpc,
instance_class=ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.MEDIUM),
multi_az=True
)
rds.DatabaseInstanceReadReplica(
self,
"WebGMRDS_ReadReplica",
engine=rds.DatabaseInstanceEngine.MYSQL,
vpc=default_vpc,
instance_class=ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.MEDIUM),
multi_az=False,
source_database_instance=avalon_rds,
security_groups=[co_sg]
)
synth output:
WebGMRDSReadReplicaSubnetGroup657CCA1E:
Type: AWS::RDS::DBSubnetGroup
Properties:
DBSubnetGroupDescription: Subnet group for WebGMRDS_ReadReplica database
SubnetIds:
- subnet-68c8b446
- subnet-dbb2b391
- subnet-a4d8aaf8
- subnet-52e49535
- subnet-1ede5a20
- subnet-ea8ca7e5
Metadata:
aws:cdk:path: avalonRDS04/WebGMRDS_ReadReplica/SubnetGroup
WebGMRDSReadReplicaF67C7A7C:
Type: AWS::RDS::DBInstance
Properties:
DBInstanceClass: db.t3.medium
CopyTagsToSnapshot: true
DBSubnetGroupName:
Ref: WebGMRDSReadReplicaSubnetGroup657CCA1E
WebGMRDS_ReadReplica (WebGMRDSReadReplicaF67C7A7C) DbSubnetGroupName should not be specified for read replicas that are created in the same region as the master (Service: AmazonRDS; Status Code: 400; Error Code: DBSubnetGroupNotAllowedFault; Request ID: 0f1315ff-6e8a-4331-85a7-1fd10c2e1a36)
This is :bug: Bug Report
I use python/typescript , get same error
1.19 have same issue , -_-!
Any progress on this?
Not yet, sorry :( I'll look into this today.
Most helpful comment
Not yet, sorry :( I'll look into this today.