aws_rds: DatabaseCluster s3ExportBuckets fails with AuroraMysqlEngineVersion.of(...) #33562
Labels
@aws-cdk/aws-rds
Related to Amazon Relational Database
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
When using AuroraMysqlEngineVersion.of(...) instead of AuroraMysqlEngineVersion.VER_3_07_1, the s3ExportBuckets feature produces an incorrect CloudFormation configuration.
Specifically, the DBClusterParameterGroup gets an unexpected difference:
• AuroraMysqlEngineVersion.of(...) adds .aurora_select_into_s3_role
• AuroraMysqlEngineVersion.VER_3_07_1 adds .aws_default_s3_role
This affects the behavior of S3 export functionality and results in inconsistent CloudFormation stacks.
This issue appears related to Issue #19735.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
When specifying the engine version with AuroraMysqlEngineVersion.of(...), the s3ExportBuckets behavior should be the same as when using AuroraMysqlEngineVersion.VER_3_07_1.
Additionally, the DBClusterParameterGroup should have the same parameters, ensuring consistency.
Current Behavior
Using AuroraMysqlEngineVersion.of("8.0.mysql_aurora.3.07.1", "8.0") results in the following incorrect CloudFormation diff:
Resources [+] AWS::S3::Bucket sampleBucket sampleBucket14E4F90B [~] AWS::RDS::DBClusterParameterGroup sampleParameterGroup sampleParameterGroup4231F25B └─ [~] Parameters └─ [+] Added: .aurora_select_into_s3_role <-- INCORRECT
However, when using AuroraMysqlEngineVersion.VER_3_07_1, the expected behavior occurs:
Resources [+] AWS::S3::Bucket sampleBucket sampleBucket14E4F90B [~] AWS::RDS::DBClusterParameterGroup sampleParameterGroup sampleParameterGroup4231F25B └─ [~] Parameters └─ [+] Added: .aws_default_s3_role <-- CORRECT
This discrepancy causes s3ExportBuckets to behave inconsistently.
Reproduction Steps
The issue can be reproduced using the following CDK code:
Incorrect behavior (AuroraMysqlEngineVersion.of(...))
Expected behavior (AuroraMysqlEngineVersion.VER_3_07_1)
Possible Solution
In cluster-engine.ts, update the of method to ensure that _combineImportAndExportRoles is correctly set based on the major version.
Specifically, if the major version is not "5.7", _combineImportAndExportRoles should be set to true.
Additional Information/Context
CDK CLI Version
v2.177.0
Framework Version
No response
Node.js Version
v22.3.0
OS
macOS Sequoia 15.3
Language
TypeScript
Language Version
5.2.2
Other information
No response
The text was updated successfully, but these errors were encountered: