(cdk bootstrap): Crashes if project name uses a underscore #29640
Labels
bug
This issue is a bug.
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
effort/medium
Medium work item – several days of effort
p2
package/tools
Related to AWS CDK Tools or CLI
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the bug
I create a project named
temporary_urls
when I got the following error when I runcdk bootstrap
:jsii.errors.JSIIError: Stack name must match the regular expression: /^[A-Za-z][A-Za-z0-9-]*$/, got 'temporary_urls'
CDK appears to give the project's name to the Stack and it fails if the name does not pass the regex verification, as the
_
is not included in the regex.Expected Behavior
I wouldn't expect CDK to fail like this as it is fairly common to use underscores for project names and the regex rule is quite restrictive. CDK should have alerted me when I defined my name in
cdk new-project
if my project name has a problem.Current Behavior
When a project name includes underscores, CDK give an error message that points to the Stack name as the source of the problem, but not the project's name:
Reproduction Steps
Followed AWS Chalice with CDK tutorial
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.134.0 (build 265d769)
Framework Version
No response
Node.js Version
v20.12.0
OS
MacOS 11.7.9
Language
Python
Language Version
Python 3.10.6
Other information
No response
The text was updated successfully, but these errors were encountered: