From 3f1c02dac7a50ce7caebce1e7f8953f6e4937e6b Mon Sep 17 00:00:00 2001 From: Jerry Kindall <52084730+Jerry-AWS@users.noreply.github.com> Date: Tue, 9 Mar 2021 16:56:14 -0800 Subject: [PATCH] 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* --- .../aws-cdk/lib/init-templates/v1/app/python/app.template.py | 4 ++-- .../aws-cdk/lib/init-templates/v2/app/python/app.template.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/aws-cdk/lib/init-templates/v1/app/python/app.template.py b/packages/aws-cdk/lib/init-templates/v1/app/python/app.template.py index bc43099fd2026..bf6da5f40868f 100644 --- a/packages/aws-cdk/lib/init-templates/v1/app/python/app.template.py +++ b/packages/aws-cdk/lib/init-templates/v1/app/python/app.template.py @@ -11,7 +11,7 @@ from %name.PythonModule%.%name.PythonModule%_stack import %name.PascalCased%Stack -app = cdk.App() -%name.PascalCased%Stack(app, "%name.StackName%") +app = core.App() +%name.PascalCased%Stack(app, "%name.PascalCased%Stack") app.synth() diff --git a/packages/aws-cdk/lib/init-templates/v2/app/python/app.template.py b/packages/aws-cdk/lib/init-templates/v2/app/python/app.template.py index a1dd331433422..5d1fa551c1c70 100644 --- a/packages/aws-cdk/lib/init-templates/v2/app/python/app.template.py +++ b/packages/aws-cdk/lib/init-templates/v2/app/python/app.template.py @@ -6,6 +6,6 @@ app = core.App() -%name.PascalCased%Stack(app, "%name.StackName%") +%name.PascalCased%Stack(app, "%name.PascalCased%Stack") app.synth()