Skip to content

Commit 3f1c02d

Browse files
author
Jerry Kindall
authored
fix(init): Python init template's stack ID doesn't match other languages (#13480)
In other languages, if you create a directory `hello-cdk`, do `cdk init`, and then `cdk ls`, you get `HelloCdkStack`. In Python you get `hello-cdk`. Change the Python init template to match the other languages. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 9910f77 commit 3f1c02d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/aws-cdk/lib/init-templates/v1/app/python/app.template.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from %name.PythonModule%.%name.PythonModule%_stack import %name.PascalCased%Stack
1212

1313

14-
app = cdk.App()
15-
%name.PascalCased%Stack(app, "%name.StackName%")
14+
app = core.App()
15+
%name.PascalCased%Stack(app, "%name.PascalCased%Stack")
1616

1717
app.synth()

packages/aws-cdk/lib/init-templates/v2/app/python/app.template.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77

88
app = core.App()
9-
%name.PascalCased%Stack(app, "%name.StackName%")
9+
%name.PascalCased%Stack(app, "%name.PascalCased%Stack")
1010

1111
app.synth()

0 commit comments

Comments
 (0)