aws / aws/aws-cdk

aws-rds: defaultDatabaseName name constrain change caused database replacement.

Open
#38,667 3 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-rds bug investigating p2 potential-regression
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

When updating DatabaseCluster with defaultDatabaseName value `${envName}-db` caused error "DatabaseName must begin with a letter and contain only alphanumeric characters".
We where forced change code into " defaultDatabaseName: `${envName}_db`," and doing some data recovery hurdles.

I think CDK has been doing defaultDatabaseName value sanitatiotion and now this functionality is removed.

### Regression Issue

- [x] Select this option if this issue appears to be a regression.

### Last Known Working CDK Library Version

2.234.1

### Expected Behavior

Name with "-" should be allowed.

### Current Behavior

Cannot use "-" symbol in database name.

### Reproduction Steps

Create aurora db on version 2.234.1 with defaultDatabaseName containning "-" in name.
CDK allow database creation.
Updated newer CDK version.
Try to update stack and get errro "DatabaseName must begin with a letter and contain only alphanumeric characters.

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### AWS CDK Library version (aws-cdk-lib)

2.234.1

### AWS CDK CLI version

--

### Node.js Version

24

### OS

Windows

### Language

TypeScript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at the aws-rds DatabaseCluster handling of defaultDatabaseName and compare behavior between CDK 2.234.1 and the newer version described. Reproduce an update using an envName-db value and verify that the generated database name remains accepted without database replacement or recovery work.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
databases, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.