4.42.0
- Non-bundled esbuild services are packaged with TypeScript compiled in place, preserving project layout and emitting each compiled file in the module format its nearest package.json declares, with a new build.esbuild.tsconfig option to select which TypeScript config is used
- Compose service resolver allows referencing other services' outputs through the variable system including services deployed to different stages using ${service:<service>.<Output>} syntax
- MCP servers now run in Dev Mode with serverless dev serving declared MCP servers where requests hit the real deployed endpoint and are answered by the local server module
- AWS variable resolvers now issue one DescribeStacks call per stack per run instead of one per referenced output, and ${aws:accountId} is resolved once per run
- All AWS resolvers (${cf:}, ${ssm:}, ${s3:}, ${aws:accountId}) retry throttled requests with exponential backoff up to 10 attempts by default
- ${cf:stackName} without an output key is now rejected before any request is made instead of issuing a request and failing with a generic message
- Terraform state is read once per run and shared across every placeholder and every Compose service instead of once per referenced output per service
- Terraform s3 backend retries throttled reads with AWS SDK standard backoff and resolves credentials once per process
- Function-level build: false is now accepted as a boolean
From serverless
Features
- Non-bundled esbuild services are packaged like classic packaging, with TypeScript compiled in place. With
build.esbuild.bundle: false, the Framework now packages your whole service the way classic packaging does: locally imported helper files are compiled and included (previously only each handler file was), JavaScript and other files are copied as they are, the project layout is preserved, and every compiled file is emitted in the module format its nearestpackage.jsondeclares (.mts→.mjs,.cts→.cjs). A newbuild.esbuild.tsconfigoption selects which TypeScript compiles, function-levelbuild: falseis accepted as a boolean, and files that esbuild plugins write into the build directory now ship in the artifact. Thanks @visrut-at-handldigital and @ewsbr for the reports. (#12744, #13163, #13850) Read more in the Building guide.
build:
esbuild:
bundle: false
# optional — tsconfig.json is picked up automatically; point at a build-specific
# config (for example one that excludes tests/**) to narrow what gets compiled
tsconfig: tsconfig.build.json
- Compose: reference other services through the variable system, including services deployed to a different stage. A new
serviceresolver reads a service's outputs inserverless-compose.yml:${service:<service>.<Output>}resolves at the current stage and deploys that service first; a named instance with astagepins the stage, so application services on personal stages can read a database service that lives once on a shared stage. References accept fallbacks and nesting like any other variable, configuration mistakes are reported before anything deploys, and the existing${<service>.<Output>}form keeps working unchanged. (#13843) Read more in the Compose guide and try the shared-services Compose example.
# serverless-compose.yml
stages:
default:
resolvers:
shared:
type: service
stage: shared-infra # the long-lived stage where orders-db lives
services:
orders-db:
path: orders-db
api:
path: api
params:
tableName: ${service:orders-db.TableName} # same stage as this run; deploys orders-db first
dbHost: ${shared:orders-db.Host} # read from orders-db@shared-infra, without deploying it here
- AWS variable resolvers make fewer requests and retry throttling.
${cf:stackName.outputKey}now issues oneDescribeStackscall per stack per run instead of one per referenced output — services deployed together with Compose share those calls, and cached reads are refreshed after each Compose service deploy — and${aws:accountId}is resolved once per run. All AWS resolvers (${cf:},${ssm:},${s3:},${aws:accountId}) retry throttled requests with the AWS SDK's standard exponential backoff, up to 10 attempts by default;AWS_MAX_ATTEMPTS/AWS_RETRY_MODEand the matching~/.aws/configkeys take precedence.--verboseshows each retry,--debugprints a per-API request summary, and exhausted retries fail with a dedicated error naming the API, the attempts made, and the remediations. Expired credentials during variable resolution now produce the familiar "AWS credentials appear to have expired" message. (#13848) Read more in the CloudFormation outputs and SSM variable guides.
Note
${cf:stackName}without an output key is now rejected before any request is made (expected '<stackName>.<outputKey>'), instead of issuing a request and failing with a generic message. This also applies when a fallback is present:${cf:stackName, 'default'}previously resolved to the fallback and now fails validation — write${cf:stackName.outputKey, 'default'}.
-
Terraform state is read once per run.
${terraform:outputs:...}now downloads and parses each Terraform state once per run and shares it across every placeholder and every Compose service, instead of once per referenced output per service. Thes3backend retries throttled reads with the AWS SDK's standard backoff, resolves credentials once per process, and reads a state bucket in another region by following S3's redirect instead of failing withPermanentRedirect. Thanks @schammah for the detailed report. (#13844, #13852) Read more in the Terraform variables guide. -
MCP servers run in Dev Mode.
serverless devnow serves the MCP servers declared undermcp: requests hit the real deployed endpoint — streaming route, authorizer, OAuth discovery and state keys all live — and are answered by your local server module, with edits applied on the next request and no redeploy. The session banner lists each server's endpoint undermcp:, and every request is logged with its JSON-RPC method and target; a JSON-RPC error carried inside a200response is called out on the same line. (#13836) Read more in theserverless devreference and the MCP servers guide; each MCP example now has a "Develop it live" section.
mcp: crm → https://abc123.execute-api.us-east-1.amazonaws.com/dev/crm/mcp
✔ Connected (Ctrl+C to cancel)
→ λ crm ── mcp tools/call get_weather
← λ crm (200) 640ms
- Provisioned mode for
sqs,kafka, andmskevents. The newprovisionedPollersevent property enables AWS Lambda's provisioned mode for event source mappings: a dedicated pool of pollers withmin/maxbounds, plusgrouponkafkaandmskto share poller capacity across mappings.provisionedPollers: falsedisables the mode on an existing mapping. Combining it withmaximumConcurrency, or settingminabovemax, fails at packaging time instead of at deployment. Thanks @sra17 for the request. (#13024, #13835) Read more in the SQS, Kafka, and MSK event guides.
functions:
worker:
handler: handler.main
events:
- sqs:
arn: arn:aws:sqs:us-east-1:123456789012:orders
provisionedPollers:
min: 2
max: 50
Note Provisioned pollers are billed while the mapping exists. Removing the property does not disable the mode on an already-deployed mapping — set
provisionedPollers: falseto turn it off.
-
SnapStart for container-image functions.
snapStart: truenow documents and validates the container-image case: functions built on the AWS base images for Java 11+, Python 3.12+ and .NET 8+ need nothing else, other images declare readiness with thecom.amazonaws.lambda.feature.snapstart="Allow"label or runtime hooks, and the guide explains how event sources reach the snapshot and what retained versions cost. ConfiguringsnapStartwithephemeralStorageSizeabove 512 MB now fails at packaging, before any image is built or pushed. Thanks @iiro for the request. (#13834, #13847) Read more in the SnapStart section of the functions guide and try the container SnapStart example. -
New Lambda runtimes, and durable functions on Java and .NET. The Amazon Linux 2023 Java runtimes
java8.al2023,java11.al2023, andjava17.al2023— AWS's migration path off the Amazon Linux 2 Java runtimes — and the public-preview runtimesnodejs26.xandpython3.15are now accepted, including byinvoke local.durableConfignow also works on Java 17+ and .NET 8+ runtimes. Thanks @mungojam for the request. (#13818, #13819) Read more in the functions guide.
functions:
api:
handler: com.example.Handler
runtime: java17.al2023
Note
nodejs26.xandpython3.15are public-preview runtimes on AWS and are not covered by AWS support or SLAs yet. Java and .NET runtimes do not include the durable execution SDK — ship it in your deployment package.
- Sandboxes: customize the operator role.
iam.operatorRoleaccepts the same customization object and external-role forms asiam.buildRoleandiam.executionRole, which makes sandboxes on shared (RAM-shared) VPCs possible. Thanks @Hi-Fi for the contribution! (#13800, #13808) Read more in the Sandboxes guide.
sandboxes:
api:
artifact: ./app
vpc:
subnetIds: [subnet-0123456789abcdef0]
securityGroupIds: [sg-0123456789abcdef0]
iam:
operatorRole:
statements:
- Effect: Allow
Action: ec2:CreateNetworkInterface
Resource: arn:aws:ec2:us-east-1:111122223333:subnet/subnet-0123456789abcdef0
- Removed the
serverless supportcommand. The interactive support-ticket flow and the--summary/--ai/--github/--allreport modes were built for a copy-paste workflow that AI coding assistants working directly in the service directory have replaced.serverless supportnow returns the standard command-not-found error, and the bug-report template asks for the framework version, a redactedserverless.yml, the command run, and its output instead. (#13820)
Bug Fixes
- CloudFormation template URLs use regional S3 endpoints. Deployments passed the deployment bucket's template to CloudFormation through the legacy global
s3.amazonaws.comendpoint. When CloudFormation's read of that template was denied by the caller's IAM policy, the failure surfaced as S3's redirect message ("The bucket you are attempting to access must be addressed using the specified endpoint") instead of the actualAccess Denied. Template URLs now uses3.<region>.amazonaws.com, so the real cause is reported;--aws-s3-accelerateand the alerts external stack follow the same rule. (#6539, #13829) npm installno longer fails when the CLI download fails. Theserverlessnpm package downloads the CLI duringpostinstall; blocked egress, an unconfigured proxy, or TLS interception previously aborted the wholenpm install. The install now completes with a warning and the download is retried on the firstserverlessrun, which still fails clearly if the download is impossible. Proxy settings from.npmrc(https-proxy,proxy,noproxy) are honored during installation when no proxy environment variables are set, error messages include the underlying network error, and a CLI terminated by a signal exits with128 + signalinstead of0. (#13833) Read more in Installing behind a proxy or firewall.--packagepaths at or above the service directory are rejected.serverless package --package .(or.., or an ancestor directory) emptied the service or parent directory before failing. Such paths now fail early withPACKAGE_PATH_CONTAINS_SERVICEand no files are touched; relative and sibling paths keep working. (#13853)- The credential-setup hint appears when no AWS credentials are found. With no
provider.profileor--aws-profileconfigured, a missing-credentials error now ends with the setup hint ("Runserverlessto set up AWS credentials…"); the hint stays off when a profile was chosen explicitly. (#13854) - A directory named like a configuration file no longer shadows the real one. A directory called
serverless.ymlnext to aserverless.yamlfile made the CLI pick the directory; only regular files are considered now. Thanks @cuishuang for the fix! (#13846) - Dev Mode labels SNS-triggered invocations correctly. Session logs showed
aws:sqs:for SNS events; they now showaws:sns:. (#13836) - Resolver configuration errors show their intended messages again. Unknown keys in
terraform,doppler,vault, andserviceresolver configurations report the allowed keys (for exampleOnly 'bucket', 'key', and 'region' are allowed in the s3 backend configuration) instead of a generic "Unrecognized key". (#13852) - MCP server: the
docstool only reads inside the documentation directory, including through symbolic links; theservice-summarytool's input schema now matches its implementation (cloudProvider), and service-wide error analysis includes Lambda log groups again. (#13851)
Maintenance
- Bumped the AWS SDK group with 107 updates across three bumps (#13815, #13823, #13839)
- Upgraded toml to v5 (#13838) — integer values in
serverless.tomloutside the 64-bit range now fail with a parse error instead of being silently rounded - Upgraded js-yaml to v4.3.2 (#13855)
- Upgraded qs to v6.16.0 (#13827)
- Upgraded fast-uri to v3.1.7 (#13831)
- Upgraded undici to v6.28.1 (#13849)
- Upgraded hono to v4.13.5 (#13805, #13824)
- Upgraded @aws-cdk/cloudformation-diff to v2.187.4 (#13814, #13825)
- Upgraded p-map to v7.0.7 (#13825)
- Upgraded tsx to v4.23.13 (#13814, #13825)
- Upgraded dayjs to v1.11.23 (#13814)
- Upgraded joi to v17.13.6 (#13814)
- Upgraded eventsource-parser to v3.1.1 (#13814)
- Upgraded @graphql-tools/merge to v9.2.3 (#13814)
- Upgraded jackson-databind used by local Java invocation (#13813)
- Upgraded jackson-core used by local Java invocation (#13811)
- Upgraded jackson-datatype-joda used by local Java invocation (#13810)
- Upgraded jest to v30.5.1 (#13840)
- Upgraded lint-staged to v17.4.1 (#13840)
- Upgraded eslint to v10.9.1 (#13824)
- Upgraded globals to v17.11.0 (#13805)
- Upgraded browserslist to v4.28.8 (#13822)