Remove support for deprecated runtimes and use the latest versions of each supported runtime#156
Conversation
… each supported runtime
There was a problem hiding this comment.
Pull request overview
This PR updates AWS Lambda runtime support to drop deprecated runtime identifiers and move defaults/docs to the newest supported runtimes, while also removing the legacy create --template flow in favor of URL- or path-based templates.
Changes:
- Remove deprecated Lambda runtimes from the AWS provider schema and TypeScript types; add/adjust tests to ensure deprecated values are rejected.
- Update default AWS runtime to
nodejs24.xacross provider/package logic and tests. - Remove built-in recommended template list / examples download path and update
createcommand + docs to use--template-url/--template-path.
Reviewed changes
Copilot reviewed 38 out of 39 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| types/index.d.ts | Removes deprecated runtime literals from AwsLambdaRuntime type. |
| test/unit/lib/templates/recommended-list.test.js | Removes unit test for the deleted recommended template list. |
| test/unit/lib/plugins/package/lib/package-service.test.js | Adds getRuntime() default runtime test; adjusts Windows executable-permissions test name. |
| test/unit/lib/plugins/create/create.test.js | Updates create command tests to use --template-path and new error code for missing template source. |
| test/unit/lib/plugins/aws/provider.test.js | Adds coverage for default runtime of AwsProvider#getRuntime(). |
| test/unit/lib/plugins/aws/package/compile/layers.test.js | Adds validation test rejecting deprecated compatibleRuntimes. |
| test/unit/lib/plugins/aws/package/compile/functions.test.js | Updates expected default runtimes and adds validation tests rejecting deprecated runtime values. |
| test/unit/lib/plugins/aws/invoke-local/index.test.js | Removes invoke-local tests for deprecated runtimes; updates provided runtime docker test to provided.al2023. |
| test/unit/lib/plugins/aws/custom-resources/index.test.js | Updates expected custom-resource Lambda runtime to nodejs24.x. |
| test/unit/lib/classes/plugin-manager.test.js | Updates create command option schema expectation to template-url. |
| test/integration/create.test.js | Updates integration tests to create from a local template path instead of built-in templates. |
| test/integration-basic.test.js | Switches lifecycle integration test to use a local Node 24 template fixture and updates handler/invoke expectations. |
| test/fixtures/programmatic/packaging/serverless.yml | Updates Go fixture runtime to provided.al2023. |
| test/fixtures/programmatic/basic-lifecycle-nodejs24/serverless.yml | New fixture for Node.js 24 lifecycle integration test. |
| test/fixtures/programmatic/basic-lifecycle-nodejs24/handler.js | New Node 24 handler fixture returning Lambda-proxy style response. |
| lib/utils/download-template-from-examples.js | Deletes legacy template download-from-examples implementation. |
| lib/templates/recommended-list/index.js | Deletes legacy list of recommended templates. |
| lib/templates/recommended-list/human-readable.js | Deletes legacy human-readable template list rendering. |
| lib/plugins/package/lib/package-service.js | Bumps packaging default runtime to nodejs24.x. |
| lib/plugins/create/create.js | Removes --template support; keeps --template-url and --template-path flows. |
| lib/plugins/aws/provider.js | Removes deprecated runtime enums and bumps provider default runtime to nodejs24.x. |
| lib/plugins/aws/invoke-local/index.js | Removes invoke-local branching for deprecated runtimes. |
| lib/cli/commands-schema/no-service.js | Removes create --template option from CLI schema. |
| docs/guides/workflow.md | Updates example create usage to --template-url. |
| docs/guides/variables.md | Updates runtime examples to nodejs24.x. |
| docs/guides/testing.md | Modernizes examples to async/await style and improves wording. |
| docs/guides/services.md | Updates runtime examples to nodejs24.x. |
| docs/guides/serverless.yml.md | Updates runtime examples and documents the new AWS default runtime behavior. |
| docs/guides/layers.md | Updates runtime examples to python3.14. |
| docs/guides/functions.md | Updates runtime examples, adds guidance on default runtimes, and modernizes handler snippets. |
| docs/guides/credentials.md | Updates runtime examples to nodejs24.x. |
| docs/getting-started.md | Updates template creation instructions to serverless create --template-url=.... |
| docs/events/websocket.md | Updates examples to async return style and AWS SDK v3 usage; updates runtime examples. |
| docs/events/cognito-user-pool.md | Updates examples to async return style. |
| docs/events/cloudfront.md | Updates example to return response instead of callback usage. |
| docs/events/apigateway.md | Updates examples to async return/throw style; updates runtime examples. |
| docs/events/alb.md | Updates handler signature and fixes minor formatting in example. |
| docs/cli-reference/print.md | Updates runtime examples to nodejs24.x. |
| docs/cli-reference/create.md | Rewrites create docs around remote/local templates; removes built-in template list. |
Comments suppressed due to low confidence (2)
lib/plugins/create/create.js:64
- In the
--template-pathbranch,serviceDirfalls back topath.join(process.cwd(), this.options.name)when--pathis omitted. If the user provides--template-pathwithout--name, this produces a directory namedundefined(and the success message will also print./undefined). Please either require--namewhen--pathis not provided, or default to a safe directory (e.g.process.cwd()/error with a clear message) and adjust the success message accordingly.
const serviceDir = this.options.path
? path.resolve(process.cwd(), untildify(this.options.path))
: path.join(process.cwd(), this.options.name);
if (dirExistsSync(serviceDir)) {
const errorMessage = `A folder named "${serviceDir}" already exists.`;
throw new ServerlessError(errorMessage, 'TARGET_FOLDER_ALREADY_EXISTS');
}
lib/cli/commands-schema/no-service.js:60
- The CLI help text for
--template-urlsays it supports only “GitHub, BitBucket”, butdownload-template-from-repoalso supports GitLab, Bitbucket Server, GitHub Enterprise, and plain.gitURLs. Please update theusagestring so the help output matches actual supported providers.
'template-url': {
usage: 'Template URL for the service. Supports: GitHub, BitBucket',
shortcut: 'u',
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 38 out of 39 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
lib/plugins/create/create.js:60
- In the
--template-pathbranch, if the user provides--template-pathbut omits both--pathand--name,serviceDirbecomespath.join(process.cwd(), this.options.name)which resolves to a literal.../undefineddirectory. Add validation to require one of--path/--name(or default toprocess.cwd()if creating in-place is supported) and throw a clearServerlessErrorinstead of creating an unexpected folder.
const serviceDir = this.options.path
? path.resolve(process.cwd(), untildify(this.options.path))
: path.join(process.cwd(), this.options.name);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 41 out of 42 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
lib/plugins/create/create.js:60
- When
--template-pathis provided without--pathand without--name,path.join(process.cwd(), this.options.name)will throw (becausenameis undefined). Either validate that at least one of--path/--nameis provided and throw aServerlessError, or support creating in the current working directory explicitly.
// Copying template from a local directory
const serviceDir = this.options.path
? path.resolve(process.cwd(), untildify(this.options.path))
: path.join(process.cwd(), this.options.name);
if (dirExistsSync(serviceDir)) {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 41 out of 42 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
lib/cli/commands-schema/no-service.js:60
- The
create --template-urloption help text says it supports "GitHub, BitBucket", butdownload-template-from-repoalso supports GitHub Enterprise, Bitbucket Server, and GitLab URLs. Consider updating the usage string to reflect the actual supported providers (and normalize the capitalization to "Bitbucket") soserverless create --helpisn't misleading.
'template-url': {
usage: 'Template URL for the service. Supports: GitHub, BitBucket',
shortcut: 'u',
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 41 out of 42 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 41 out of 42 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 41 out of 42 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 42 out of 43 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 42 out of 43 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.