Aws-cdk: DbSubnetGroupName should not be specified for read replicas that are created in the same region as the master

Created on 23 Dec 2019  路  4Comments  路  Source: aws/aws-cdk


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

Reproduction Steps

Error Log

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)

Environment

  • **CLI Version : 1.18.0 (build bc924bc)
  • Framework Version:
  • **OS : osx
  • **Language : python

Other


This is :bug: Bug Report

@aws-cdaws-rds bug p1

Most helpful comment

Not yet, sorry :( I'll look into this today.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eladb picture eladb  路  3Comments

pepastach picture pepastach  路  3Comments

peterdeme picture peterdeme  路  3Comments

PaulMaddox picture PaulMaddox  路  3Comments

cybergoof picture cybergoof  路  3Comments