aws-cdk: aws-rds: Cannot add a region to Aurora Global Database
Describe the bug
When creating an Global Aurora Database, you cannot add another Region to it.
We get an error message Resource handler returned message: "Invalid master password
Expected Behavior
You should be able to add additional Regions to Aurora Global Database.
Once a Global Database is created, you can create a secondary Cluster and add globalClusterIdentifier . Even though there is not L2 construct for adding a cluster to Global Database, L1 construct CfnDBCluster should allow you to specify globalClusterIdentifier.
Current Behavior
When you try and create the secondary cluster using CfnDBCluster construct, following error is thrown by CloudFormation Resource handler returned message: "Invalid master password . Even though based on the documentation, if you specify globalClusterIdentifier , you can’t then give master password as it uses the one from source DB cluster.
Reproduction Steps
- Create a standard Aurora DB Cluster using
DatabaseCluster - Create a Global Database using
CfnGlobalClusterand add source DB Cluster as the one created in step one. - Create a secondary DB Cluster using
CfnDBClusteras following
const cfnDBCluster = new rds.CfnDBCluster(this, 'AuroraCluster', {
globalClusterIdentifier: `${props.auroraglobalcluster}-${props.envName}`,
dbClusterParameterGroupName: 'default.aurora-mysql8.0',
enableGlobalWriteForwarding: true,
availabilityZones: vpc.availabilityZones,
dbSubnetGroupName: dbSubnetGroup.dbSubnetGroupName,
engine: 'aurora-mysql',
engineVersion: '8.0.mysql_aurora.3.04.0',
kmsKeyId: 'alias/aws/rds'
})
for (const az in vpc.availabilityZones) {
const cfnDBInstance = new rds.CfnDBInstance(this, `AuroraInstance-${props.envName}-${az}`, {
dbClusterIdentifier: cfnDBCluster.dbClusterIdentifier,
engine: 'aurora-mysql',
dbInstanceClass: 'db.r6g.large',
publiclyAccessible: false,
availabilityZone: vpc.availabilityZones[az]
})
}
This would produce an error message by CloudFormation.
Possible Solution
Either fix the bug in CfnDBCluster construct to support GlobalDatabases or create add GlobalDatabase support in L2 construct DatabaseCluster
Additional Information/Context
No response
CDK CLI Version
2.131.0
Framework Version
No response
Node.js Version
v18.16.0
OS
macOS 14.3.1
Language
TypeScript
Language Version
No response
Other information
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (7 by maintainers)
Great help from the team to find a resolution for this issue
Thanks for all the help @pahud