Swift AWS Lambda Runtime v2 is here! ![]()
We’re excited to announce the official release of Swift AWS Lambda Runtime v2, a major update that brings a complete redesign for Swift 6, modern concurrency, and powerful new features for building Lambda functions in Swift.
Thank you @fabianfett, @aryan25, @adam-fowler and all community members for your code contributions, reviews, and feedback.
What’s New in v2?
- Async/Await-First API: Full integration with Swift 6 structured concurrency for cleaner, safer, and more readable code.
- Response Streaming: Easily stream large responses (up to 200MB) with incremental delivery and custom HTTP headers/status codes. Improve time-to-first-byte and reduce memory use!
- Background Task Execution: Run tasks after the Lambda response is sent, enabling analytics, logging, or cache updates without affecting latency.
- Own the
main()Function: Gain full control over initialization and dependency injection, supporting advanced use cases and service lifecycle management. - Swift Service Lifecycle Integration: Seamless management of graceful shutdown and resource cleanup via ServiceGroup.
- Swift 6 Compatibility: Concurrency checking, non-blocking I/O (SwiftNIO foundation), and robust performance.
Migration Notes:
- v2 brings a new async/await API. Check out the updated documentation.
- Many new examples are available to help you get started, including streaming responses, background processing, and API Gateway integrations.
Full release notes and migration details: Release 2.0.0 · swift-server/swift-aws-lambda-runtime · GitHub
What's next?
We've collected a couple of ideas and priorities for 2.1, the main efforts should be driven towards:
- Reducing cold start time (#579) (explore deployment of small OS images with OCI deployment, strip the binary, use the Linux Static SDK for MUSL or create a static linux SDK for Amazon Linux 2023)
- Add support for distributed tracing (#185)
- Improve the doc
Your feedback matters. Tell us what is important for you and we'll help to prioritize.