Skip to content

Commit f2b5390

Browse files
committed
fix(project): set runtimeVersion on the CodeZip template
The CDK construct library rejects a CodeZip runtime that declares no runtimeVersion ("runtimeVersion is required for CodeZip builds"), and it is the field that selects the packager. Without it, synthesizing a freshly created python project fails on its own scaffolded config. Container builds take their version from the image, so the container template is unaffected.
1 parent 65deac9 commit f2b5390

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/core/project/manager.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ describe("FsProjectManager.create", () => {
9797
build: "CodeZip",
9898
entrypoint: "main.py",
9999
codeLocation: "app/hello-world",
100+
runtimeVersion: "PYTHON_3_14",
100101
},
101102
]);
102103
expect(await Bun.file(join(configDir, "aws-targets.json")).json()).toEqual([]);

src/core/project/templates.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ export const TEMPLATES: Record<ProjectTemplate, Template> = {
3232
build: "CodeZip",
3333
entrypoint: "main.py",
3434
codeLocation: "app/hello-world",
35+
// Required for CodeZip builds: the CDK construct library rejects a
36+
// CodeZip runtime with no runtimeVersion, and it is what selects the
37+
// packager. Container builds take their version from the image.
38+
runtimeVersion: "PYTHON_3_14",
3539
},
3640
],
3741
},

0 commit comments

Comments
 (0)