Repository navigation
chore(deps): update swift aws lambda runtime - #16
Merged
Merged
Conversation
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.
This PR contains the following updates:
from: "2.3.1"→from: "2.11.0"from: "0.4.0"→from: "0.5.0"Release Notes
awslabs/swift-aws-lambda-runtime (awslabs/swift-aws-lambda-runtime)
v2.11.0Compare Source
This release contains two important changes. Please read the migration notes below before upgrading.
1. Amazon Linux 2023 is now the default build container
Starting June 30, 2026, Amazon Linux 2 has reached end of support. Following the plan described in #668 and the Swift Forum discussion, the Swift Lambda Runtime plugins now use Amazon Linux 2023 (
swift:<version>-amazonlinux2023) as the default base Docker image for cross-compiling your code.If you need to keep building for Amazon Linux 2 during the transition, you can still pass
--base-docker-image swift:<version>-amazonlinux2explicitly.PR: #675
2. New plugins available on Swift 6.4+
The new plugin system,
lambda-init,lambda-build, andlambda-deploy(introduced in #567), is now available, but requires Swift 6.4 or later. See the user guide in #567.TL;DR
Why Swift 6.4? The new plugins depend on
soto-core, which transitively depends onswift-crypto.swift-cryptodeclares a minimum macOS platform requirement that is incompatible with this package, which intentionally does not declare aplatforms:section (to avoid forcing platform minimums onto downstream packages). Prior to Swift 6.4, SwiftPM's hardcoded default macOS deployment target was too low to satisfy that requirement. Swift 6.4 raises SwiftPM's default macOS deployment target to v12, which satisfiesswift-cryptoandsoto-corewithout us having to reintroduce aplatforms:declaration. These plugins are therefore gated behind Swift 6.4.Compatibility: The legacy
archiveplugin remains available on all supported Swift versions so your existing CI does not break. Please migrate tolambda-buildwhen you move to Swift 6.4.Something broken?
If this release breaks your build or deployment, please file an issue so we can help.
What's Changed
SemVer Minor
SemVer Patch
Other Changes
Full Changelog: awslabs/swift-aws-lambda-runtime@2.10.0...2.11.0
v2.10.0Compare Source
What's new
Amazon Linux 2023 migration. The archive plugin now displays a deprecation warning when building on or for Amazon Linux 2. AL2 reaches End of Life on June 30, 2026, and the plugin default will switch to Amazon Linux 2023 after that date. To migrate today, add
--base-docker-image swift:amazonlinux2023to your archive command and update your Lambda deployment to use theprovided.al2023runtime. All examples have been updated to build and deploy on Amazon Linux 2023.Dropped Swift 6.0 support. The library now requires Swift 6.1 or later, following the ecosystem policy of supporting the last three major versions (6.1, 6.2, 6.3).
Other changes
NIOLockedValueBoxwithSynchronization.Mutex, removing a workaround for a compiler crash that no longer applies.log(event:)protocol method. The JSON log handler now also includessourceanderrorfields in structured output, making it easier to filter logs in CloudWatch by module and spot errors without digging through metadata.Package@swift-6.0.swiftand all#if compiler/#if swiftguards that only existed to support 6.0.v2.9.0Compare Source
This releases add support for sharing the CloudWatch log name and log stream name, similar to the runtime interface client for other languages.
LambdaContextoffers two new variables:/// The name of the Amazon CloudWatch Logs group for the function. public var logGroupName: String { self.storage.logGroupName } /// The name of the Amazon CloudWatch Logs stream for the current invocation of the function. public var logStreamName: String { self.storage.logStreamName }You can use them with:
What's Changed
SemVer Minor
Other Changes
Full Changelog: awslabs/swift-aws-lambda-runtime@2.8.0...2.9.0
v2.8.0Compare Source
This releases adds support for JSON Structured Logging
JSON structured logging lets CloudWatch capture your Lambda logs as searchable key-value pairs instead of plain text, making it significantly easier to filter, query, and debug in production. It also enables you to attach metadata and contextual information (like request IDs or error codes) to each log entry, which is essential for automated analysis at scale. This is especially relevant since Lambda Managed Instances only support JSON log format — so this release brings the Swift runtime in line with that requirement.
Example of log entry:
{ "message": "Server started and listening", "requestId": "N\/A", "level": "INFO", "timestamp": "2026-02-24T18:43:11.688Z", "metadata": { "port": "7000", "host": "\"127.0.0.1\"" }, "traceId": "N\/A", "file": "AWSLambdaRuntime\/Lambda+LocalServer.swift", "function": "withLocalServer(host:port:invocationEndpoint:eventLoopGroup:logger:_:)", "line": 168 }There is nothing to change in your code to activate JSON Structured logging, this is a configuration at the function level either in the console, your IaC code, or the CLI when you create or update a function. Behind the scene, the Lambda service sets
AWS_LAMBDA_LOG_FORMAT=JSON. Similarly, you can control the log level directly from the console or your IaC code.We added an example in
Examples/JSONLogging:The old behaviour of text-based logging and verbosity control through the
LOG_LEVELenvironment variable is preserved. This is a purely additive change.Learn more about Lambda Structured Logging in the doc: https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs-logformat.html
Acknowledgements
I'd like to thank @manojmahapatra and @benrosen78 for their contributions on these two new capabilities.
What's Changed
SemVer Minor
SemVer Patch
Other Changes
Full Changelog: awslabs/swift-aws-lambda-runtime@2.7.0...2.8.0
v2.7.0Compare Source
The archive plugin now supports Apple's container CLI as an alternative to Docker for building Lambda deployment packages.
Pass
--container-cli containerto use it instead of the default Docker path. The plugin translates commands accordingly, usingcontainer image pullandcontainer rununder the hood.To use it:
Note that even when using Apple's container CLI, you still need to pass
--allow-network-connections dockeron the command line. This is a SwiftPM limitation, not something the plugin controls. In a future version, SPM will not prompt for specific authorization when--disable-sandboxis specified (see swiftlang/swift-package-manager#9763)Docker remains the default. If you don't pass
--container-cli, nothing changes.What's Changed
SemVer Minor
Full Changelog: awslabs/swift-aws-lambda-runtime@2.6.3...2.7.0
v2.6.3Compare Source
We fixed a bug and improved the life for those of you building on Amazon Linux 2023.
[bug] the local HTTP server you use for testing your functions locally was not forwarding the HTTP headers you passed to the Lambda function. This prevented you local testing of function that expects some specific HTTP headers or to test Lambda Multi Tenant. @manojmahapatra fixed this and added a Multi Tenant example to show you how to pass test multi tenant functions locally, with
curl. This is Manoj's first contribution to the project. Welcome and thank you.[plugin] : the
archiveplugin now correctly recognises it runs on Amazon Linux 2023 and doesn't attempt to build with docker anymore. Thank you @0xTim for having reported that.As usual, let us know your feedback, comments, or suggestions.
What's Changed
SemVer Patch
New Contributors
Full Changelog: awslabs/swift-aws-lambda-runtime@2.6.2...2.6.3
v2.6.2Compare Source
This is a patch release that fixes two rare concurrency issues. One was when using the
swift package archiveplugin. And the second one was when the server (Lambda control plane) closes the HTTP connection, which practically never happens, except when using the local HTTP server during your tests.I observed these problems mostly in our CI/CD pipeline.
Let us know if you also experimented crashes when the server closes the HTTP connection or with the
archiveplugin.What's Changed
SemVer Patch
Full Changelog: awslabs/swift-aws-lambda-runtime@2.6.1...2.6.2
v2.6.1Compare Source
Add a Swift docc page to cover Lambda Managed Instances introduced in release 2.6.0
It will eventually be available at https://swiftpackageindex.com/awslabs/swift-aws-lambda-runtime/~/documentation/awslambdaruntime
What's Changed
SemVer Patch
Full Changelog: awslabs/swift-aws-lambda-runtime@2.6.0...2.6.1
v2.6.0Compare Source
Lambda Managed Instances Support
We're excited to announce support for AWS Lambda Managed Instances in the Swift AWS Lambda Runtime. This new deployment model enables you to run Lambda functions on your current-generation Amazon EC2 instances while maintaining serverless simplicity.
What are Lambda Managed Instances?
Lambda Managed Instances provide EC2 flexibility and cost optimization by running your functions on customer-owned EC2 instances. AWS handles all infrastructure management tasks including instance lifecycle, OS and runtime patching, routing, load balancing, and auto-scaling. The key difference from traditional Lambda is support for concurrent invocations within the same execution environment, allowing multiple requests to be processed simultaneously on the same host.
When to Use Lambda Managed Instances
Lambda Managed Instances are ideal for:
Code Changes Required
Migrating to Lambda Managed Instances requires two simple changes:
1. Use
LambdaManagedRuntimeinstead ofLambdaRuntime2. Ensure Handlers are
SendableBecause Lambda Managed Instances support concurrent invocations, your handler functions and structs must conform to
Sendable:For simple data structures, the Swift compiler automatically infers
Sendableconformance.Implementation Details
AWS_LAMBDA_MAX_CONCURRENCY) and launches the appropriate number of Runtime Interface Clients (RICs) to handle concurrent requestsAWS_LAMBDA_MAX_CONCURRENCYis 1 or unset, the runtime maintains single-threaded behavior for optimal performance on traditional Lambda deploymentsThis is a purely additive feature with no breaking changes—existing Lambda functions continue to work without modification. The managed instances support is implemented behind a Swift package trait (
ManagedRuntimeSupport) that's enabled by default. If you're concerned about binary size and don't need managed instances support, you can disable this trait in yourPackage.swift:Examples
The release includes three comprehensive examples in
Examples/ManagedInstances/:See the ManagedInstances example README for deployment instructions using AWS SAM.
Prerequisites
Before deploying to Lambda Managed Instances:
Additional Resources
What's Changed
SemVer Minor
Full Changelog: awslabs/swift-aws-lambda-runtime@2.5.3...2.6.0
v2.5.3Compare Source
This patch release fixes two critical race conditions that could cause crashes in production and test environments:
Bug Fixes
LambdaRuntimeClientchannel lifecycle (#632)Lambda+LocalServercausingNIOAsyncWriterfatal error (#636)These fixes improve the stability and reliability of the Swift AWS Lambda Runtime, particularly in high-concurrency scenarios.
What's Changed
SemVer Patch
Full Changelog: awslabs/swift-aws-lambda-runtime@2.5.2...2.5.3
v2.5.2Compare Source
Local server test hangs: Fixed race conditions in Pool cancellation logic that caused test suite to hang ~10% of the time
Impact: Test suite now runs consistently without hangs. Local server testing is more reliable.
What's Changed
SemVer Patch
Other Changes
Full Changelog: awslabs/swift-aws-lambda-runtime@2.5.1...2.5.2
v2.5.1Compare Source
This patch sharpens the developer experience: the payload trace limit is lifted, so you get 6 Mb traces when inspecting Lambda events and responses. In practice, this means clearer insight into real-world payloads, faster root-cause analysis, and fewer blind spots when debugging.
What's Changed
SemVer Patch
Full Changelog: awslabs/swift-aws-lambda-runtime@2.5.0...2.5.1
v2.5.0Compare Source
This release relaxes
Sendableconstraint onStreamingClosureHandler.Key changes:
Sendableconformance fromStreamingClosureHandlerstruct@Sendableannotation from the closure type used in the handlerWhat's Changed
SemVer Minor
Other Changes
Full Changelog: awslabs/swift-aws-lambda-runtime@2.4.1...2.5.0
v2.4.1Compare Source
A dot release that mostly fixes the compilation error introduced by a breaking API change in swift Log.
Beside that, here are some newsworthy changes
What's Changed
SemVer Minor
Other Changes
Full Changelog: awslabs/swift-aws-lambda-runtime@2.4.0...2.4.1
v2.4.0Compare Source
This release adds support for AWS Lambda tenant isolation mode.
https://aws.amazon.com/blogs/aws/streamlined-multi-tenant-application-development-with-tenant-isolation-mode-in-aws-lambda/
See
Examples/MultiTenantfor a full example.What's Changed
SemVer Minor
Other Changes
Full Changelog: awslabs/swift-aws-lambda-runtime@2.3.1...2.4.0
swift-server/swift-aws-lambda-events (swift-server/swift-aws-lambda-events)
v0.5.0Compare Source
Main Changes
All changes
New Contributors
Full Changelog: awslabs/swift-aws-lambda-events@0.4.0...0.5.0
Configuration
📅 Schedule: (in timezone Pacific/Auckland)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.