feat(gen2-migration): generate code for non-JS Lambda functions - #14972
Open
sharonyajain wants to merge 1 commit into
Open
feat(gen2-migration): generate code for non-JS Lambda functions#14972sharonyajain wants to merge 1 commit into
sharonyajain wants to merge 1 commit into
Conversation
…-migration Support Python, Go, Java, .NET, and Ruby runtimes in the gen2-migration generate command. Previously non-JS functions threw an UnsupportedRuntimeError; now they produce a resource.ts using Gen2's custom function pattern (defineFunction((scope) => new Function(scope, ...))) with the appropriate CDK Runtime enum, runtime-specific bundling, and source copying that retains non-JS dependency manifests (requirements.txt, go.mod, pom.xml, etc.). - FunctionAssessor: mark all runtimes as supported for generate - FunctionRenderer: add renderCustomFunction(), mapToCdkRuntime(), renderBundlingBlock() - FunctionGenerator: branch non-JS runtimes into the custom function path; runtime-aware copyFunctionSource - Tests updated/added across assessor, renderer, generator, and orchestrator suites (444 gen2-migration tests pass) Closes #14535
sharonyajain
force-pushed
the
feat/gen2-migration-non-js-functions
branch
from
August 21, 2026 14:46
9caa448 to
268ade1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Resolves #14535 —
gen2-migration generatenow produces Gen2 code for non-JS Lambda functions (Python, Go, Java, .NET, Ruby) instead of throwing or skipping them.Previously, the generate command only supported Node.js runtimes. PR #14744 added a skip path (via
--skip-validations), but left users to hand-code the Gen2 definition. This PR completes the feature by generating the fullresource.tsusing Gen2's custom functions pattern.What it generates (example for Python):
Key changes:
FunctionAssessor: All runtimes are nowsupportedfor generate (removed theisNonJsRuntimegate)FunctionRenderer: NewrenderCustomFunction()method emits the CDK Function construct pattern with runtime-specific bundlingFunctionGenerator: Removed the throw for non-JS runtimes; branches into custom path when!runtime.startsWith('nodejs')copyFunctionSource: Preserves dependency files (requirements.txt, go.mod, pom.xml) for non-JS functionsmapToCdkRuntime(): Maps Lambda runtime strings → CDKRuntime.*enum membersRuntime support:
Issue #, if available
Closes #14535
Description of how you validated changes
validFor('generate')does not render runtime for non-nodejsstill passes (Node.js path unchanged)Checklist
yarn testpasses (gen2-migration tests)By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.