Describe the bug
My DatabaseCluster ist configured with engine: rds.DatabaseClusterEngine.AuroraMysql
and no custom ClusterParameterGroup
is configured.
The following Exception is thrown:
DBClusterParameterGroup not found: default.aurora5.6 (Service: AmazonRDS; Status Code: 404; Error Code: DBClusterParameterGroupNotFound;
To Reproduce
new rds.DatabaseCluster(this, 'prodRdsCuster', {
clusterIdentifier: 'rds-prod',
engine: rds.DatabaseClusterEngine.AuroraMysql,
instances: 1,
port: 3306,
defaultDatabaseName: 'app',
masterUser: {
username: 'admin'
},
instanceProps: {
instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Medium),
securityGroup: rdsSecurityGroup,
vpc: props.vpc,
vpcSubnets: {
subnetType: ec2.SubnetType.Isolated,
}
},
backup: {
preferredWindow: '02:00-03:00',
retentionDays: 21
},
preferredMaintenanceWindow: 'Sun:03:00-Sun:04:00'
});
cdk deploy
Expected behavior
Successful deployment
Version:
Workaround
Create a ClusterParameterGroup with explicit family setting:
const rdsClusterPrameterGroup = new ClusterParameterGroup(this, 'rdsClusterPrameterGroup', {
description: 'MySQL 5.7',
family: 'aurora-mysql5.7'
}
and use it in your cluster with
parameterGroup: rdsClusterPrameterGroup
Also already experienced this.
I think this is a bug in RDS. The problem is that the default.xxx
parameter groups (created by AWS) are created only after creating a instance/cluster in the console or using the API directly. So if you never created a instance/cluster this way in a region and you try to deploy with CloudFormation it will not find the default.xxx
parameter group.
@jogold Incorrect. I just launched a cluster with a default parameter group
this.db = new DatabaseCluster(this, "Database", {
engine: rds.DatabaseClusterEngine.AuroraPostgresql,
engineVersion: "10.7",
masterUser: {
username: "admin",
},
defaultDatabaseName: "main",
instanceProps: {
instanceType: new ec2.InstanceType("r5.large"),
vpcSubnets: {
subnetType: ec2.SubnetType.Private,
},
vpc,
},
storageEncrypted: true,
parameterGroup: {
parameterGroupName: "default.aurora-postgresql10",
} as any,
});
Note: The engineVersion
props comes from my PR https://github.com/awslabs/aws-cdk/pull/2698
@joehillen So how can we create a new parameter group and override some parameters rather using the default one? See below sample code
const parameterGroup = new ParameterGroup(this, 'ParameterGroup', {
family: 'aurora-mysql5.7',
parameters: {
max_connections: '100'
}
});
If you need to do this in Python, to use the default parameter group for Aurora MySQL 5.7, use this:
pg = rds.ClusterParameterGroup.from_parameter_group_name(self, 'ParameterGroup', "default.aurora-mysql5.7")
The bug is still present
The bug is still present
Yep. I can tell you I'm working on it right now. Stay tuned.
Most helpful comment
Also already experienced this.
I think this is a bug in RDS. The problem is that the
default.xxx
parameter groups (created by AWS) are created only after creating a instance/cluster in the console or using the API directly. So if you never created a instance/cluster this way in a region and you try to deploy with CloudFormation it will not find thedefault.xxx
parameter group.