v2.0.0 #1641
Closed
heitorlessa
started this conversation in
Show and tell
v2.0.0
#1641
Replies: 1 comment 2 replies
-
So that means that just by importing a layer with power tools I will not have to import pydantic layer too? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
We are extremely happy to announce the smallest release version ever - v2.0.0 🎉🎉!
The number one customer request was reducing package size. Some customers use a different tracing provider. Others used Parser (Pydantic) for data modelling and deep data validation instead of JSON Schema Validation. A few brought large machine learning models and every bit of space they can save matters.
The number two request was ARM64 support. Customers want to benefit from performance and cost savings for their workloads. However, they don’t want to invest additional time testing and compiling dependencies they use daily for ARM64.
We’ve spent the past 2 months optimizing as much as we could. We kept breaking changes to a minimum to make your transition to v2 as smooth as possible.
For backwards incompatible changes, we’ve spent considerable effort making sure they are visible, why we implemented them, and and what to do if they affect you.
Our sincerest appreciation for the community help and patience while we’ve worked on this release - Thank you ❤️!
What's New in V2
Python compatibility
We dropped support for Python 3.6. We highly recommend moving to the latest Python available in AWS Lambda (3.9).
Package size reduction by 97.6%
We now rely on AWS SDK available in the Lambda runtime, and all other dependencies are marked as optional.
There are subtle but important differences in the installation experience - PyPi (all optional) and Lambda Layer (all included).
PyPi
The compressed package size is now approximately 240K (previously 10M).
We updated each documentation to emphasize when an additional dependency is required (Tracer, Validation and Parser). If you prefer to install all of them, use pip install
aws-lambda-powertools[all]
.Note. If you need to use newer AWS services or features not available in the Lambda runtime provided SDK, you'll need to bundle
boto3
as a dependency.Lambda Layer
The compressed package size is now approximately 2M (previously 17M).
Lambda Layer includes all dependencies. They're also optimized for package size and speed (Pydantic now compiled with Cython for ~30-50% speed gain).
ARM Support
We now offer full support to ARM via Lambda Layer and SAR installation. All C-extension dependencies are compiled, optimized and tested against Lambda environment.
PyPi and Lambda Layer available upon release notes event
You can now safely subscribe to GitHub Release event to know when PyPi and Lambda Layer ARNs have the latest version.
Previously, PyPi, Lambda Layers, and docs were updated after a release notes went live to GitHub (~15m completion). Due to Lambda Layer compilation (x86/ARM64), this process takes on average 30m longer.
As such, we make releases prior to sharing release notes, guaranteeing for customers watching for GitHub Releases that Layer ARNs available in the documentation match PyPi releases (no more delays).
Event Handler REST new features
Multi-value header and cookies support
When returning custom responses, you now can add a list of values for a header, including cookies.
Event Handler will seamless adapt to the expected format based on resolver used, whether that is REST API, HTTP API, ALB, or Function URL.
NOTE. For ALB, you have to explicitly enable multi-value headers in the target configuration.
Trailing slash route support
APIGatewayRestResolver
now seamless support route resolution with trailing slashes:/todos/
.Previously, requests with a trailing slash would return HTTP 404 due to route mismatch.
Note. This was not necessary for HTTP API and ALB.
Fully qualified names for Tracer subsegments
tracer.capture_method
ortracer.capture_lambda_handler
decorators now use the decorated function or method fully qualified name as the subsegment name.This enables accurate traces for ABC or Protocol classes, where their method name will be the same but for distinct classes.
Backwards incompatible change in v2
Here’s a quick view of deprecated features removed and backwards incompatible changes.
BatchProcessor
.POWERTOOLS_EVENT_HANDLER_DEBUG
in favour ofPOWERTOOLS_DEV
.AttributeValue
with native Python types.GetConfiguration
API deprecation.Event Source Data Classes DynamoDBStreamEvent
You will now receive native Python types when accessing DynamoDB records via
keys
,new_image
, andold_image
attributes in DynamoDBStreamEvent.Previously, you'd receive an
AttributeValue
instance. For most customers, this made it difficult to handle Change Data Capture use cases due to having an additional step to deserialize data to Python native types (str
,dict
etc) when processing them.Feature Flags and Parameters AppConfig new IAM permission
We replaced
GetConfiguration
API (now deprecated) withGetLatestConfiguration
andStartConfigurationSession
.As such, you must update your IAM Role permissions to allow the following IAM actions:
appconfig:GetLatestConfiguration
appconfig:StartConfigurationSession
Idempotency partition key format
Similar to Tracer, we also updated Idempotency to use fully qualified name. This means that recent non-expired idempotent transactions will be ignored.
Deprecated features removed
Legacy SQS Batch Processor
We removed the deprecated
PartialSQSProcessor
class andsqs_batch_processor
decorator in favour ofBatchProcessor
launched 11 months ago.BatchProcessor
provides nearly the same developer experience while improving speed and security, as it natively integrates with Lambda ReportBachItemFailures feature.POWERTOOLS_EVENT_HANDLER_DEBUG environment variable
We removed the
POWERTOOLS_EVENT_HANDLER_DEBUG
environment variable in favour ofPOWERTOOLS_DEV
.POWERTOOLS_DEV consolidate additional features to ease prototyping against local or non-production environment.
Changes
🌟New features and non-breaking changes
📜 Documentation updates
🐛 Bug and hot fixes
🔧 Maintenance
This release was made possible by the following contributors:
@barreeeiroo, @dependabot, @dependabot[bot], @heitorlessa, @kt-hr, @leandrodamascena, @rubenfonseca, @ryandeivert, @shanab, @walmsles, @ran-isenberg and Release bot
This discussion was created from the release v2.0.0.
Beta Was this translation helpful? Give feedback.
All reactions