v1.20.0 #633
Closed
heitorlessa
started this conversation in
Show and tell
v1.20.0
#633
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
This release highlights 1/ support for Python 3.9, 2/ support for API Gateway and AppSync Lambda Authorizers, 3/ support for API Gateway Custom Domain Mappings, 4/ support to make any Python synchronous function idempotent, and a number of documentation improvements & bugfixes.
Lambda Authorizer support
AppSync
This release adds Data Class support for
AppSyncAuthorizerEvent
,AppSyncAuthorizerResponse
, and correlation ID in Logger.You can use
AppSyncAuthorizerEvent
to easily access all self-documented properties, andAppSyncAuthorizerResponse
to serialize the response in the expected format.API Gateway
This release adds support for both Lambda Authorizer for payload v1 -
APIGatewayAuthorizerRequestEvent
,APIGatewayAuthorizerResponse
- and v2 formatsAPIGatewayAuthorizerEventV2
,APIGatewayAuthorizerResponseV2
.Similar to AppSync, you can use
APIGatewayAuthorizerRequestEvent
andAPIGatewayAuthorizerEventV2
to easily access all self-documented properties available, and its correspondingAPIGatewayAuthorizerResponse
andAPIGatewayAuthorizerResponseV2
to serialize the response in the expected format.v2 format
v1 format
Custom Domain API Mappings
When using Custom Domain API Mappings feature, you must use the new
strip_prefixes
param in theApiGatewayResolver
constructor.Scenario: You have a custom domain
api.mydomain.dev
and set an API Mappingpayment
to forward requests to your Payments API, the path argument will be/payment/<your_actual_path>
.This will lead to a HTTP 404 despite having your Lambda configured correctly. See the example below on how to account for this change.
Make any Python function idempotent
Previously, you could only make the entire Lambda function handler idempotent. You can now make any Python function idempotent with the new
idempotent_function
.This also enables easy integration with any other utility in Powertools. Take example the Batch utility, where you wouldn't want to make the entire Lambda handler idempotent as the batch will vary, instead you'd want to make sure you can process a given message only once.
As a trade-off to allow any Python function with an arbitrary number of parameters, you must call your function with a keyword argument, and you tell us upfront which one that might be using
data_keyword_argument
, so we can apply all operations like hashing the idempotency token, payload extraction, parameter validation, etc.Changes
🌟New features and non-breaking changes
📜 Documentation updates
🐛 Bug and hot fixes
🔧 Maintenance
This release was made possible by the following contributors:
@dependabot, @dependabot[bot], @heitorlessa, @hjurong and @michaelbrewer
This discussion was created from the release v1.20.0.
Beta Was this translation helpful? Give feedback.
All reactions