aws-rds: removing parameter from parameter group does not set it to the default value
Describe the bug
I am unable to set a parameter group parameter to its default value without setting it explicitly in CDK.
Expected Behavior
When I remove a parameter from a CDK created parameter group, I expect that parameter to be handled by the AWS defaults as if I had pressed "Set to default value" for the parameter in the AWS Management Console.
Current Behavior
When a parameter is removed from a parameter group in AWS CDK, it remains as the same value in AWS Management Console.
Reproduction Steps
Deploy a parameter group with the following JavaScript code:
const mysql8ParameterGroupParameters = {
character_set_client: "utf8",
character_set_connection: "utf8",
character_set_database: "utf8",
character_set_filesystem: "utf8",
character_set_results: "utf8",
character_set_server: "utf8",
collation_connection: "utf8_unicode_ci",
collation_server: "utf8_unicode_ci",
innodb_strict_mode: "1"
};
const mysql8DatabaseClusterParameterGroup = new rds.CfnDBClusterParameterGroup(
this,
"mysql-8-database-cluster-parameter-group",
{
dbClusterParameterGroupName: `myParamGroup`,
family: "aurora-mysql8.0",
parameters: mysql8ParameterGroupParameters
});
Then remove all the collation.. and character_set... parameters and deploy the changes.
Observe that the parameters are still set to utf8 in AWS Management Console rather than the defaults.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.129.0
Framework Version
No response
Node.js Version
v21.6.2
OS
Mac OS
Language
TypeScript
Language Version
JavaScript
Other information
No response
I created a new parameter group like this without specifying some props(comment off):
const mysql8ParameterGroupParameters3 = {
// character_set_client: "utf8",
// character_set_connection: "utf8",
// character_set_database: "utf8",
// // character_set_filesystem: "utf8",
// character_set_results: "utf8",
// character_set_server: "utf8",
collation_connection: "utf8_unicode_ci",
collation_server: "utf8_unicode_ci",
innodb_strict_mode: "1"
};
const mysql8DatabaseClusterParameterGroup = new rds.CfnDBClusterParameterGroup(
this,
"mysql-8-database-cluster-parameter-group",
{
dbClusterParameterGroupName: `myParamGroup`,
family: "aurora-mysql8.0",
parameters: mysql8ParameterGroupParameters,
description: 'test',
});
And I check character_set_client and character_set_connection from the RDS console. Their values are all utf8.
Can you be specific and tell me which attribute should not be utf8 by default so I can investigate it further?
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
@pahud By default, the parameters should appear as blank in the management console like in this screenshot.
This is what I would expect to see if CDK had the correct behaviour.
If you do not specify those attributes, CDK would not synthesize for that explicitly and the default values would be determined by CFN, not CDK. I am afraid this is not something CDK can do. What do you think?
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.