Changes
This release brings a number of minor but importance enhancements in Logger, Parameters, Data Classes, Idempotency.
Also, this release wouldn't have been possible without @michaelbrewer relentless contribution - Thank you, Michael!!
Logger
You can now inject correlation IDs coming from any Event Source using JMESPath expressions, or by manually injecting a string with set_correltion_id
.
Another enhancement that goes nicely with any Logging Analytics solution such as Amazon CloudWatch Logs Insights, Kibana, Datadog, Splunk, Loggly, etc is the ability to enumerate exceptions across all your functions - A new field exception_name
will be added to your Logs when using logger.exception()
.
Data Classes
You can now have a self-documented schema for AppSync Lambda Resolvers whether you use Direct Lambda Resolver feature, or @function
GraphQL Transformer with Amplify CLI. More importantly, scalar type utilities such as timestamps, timezone offsets, UUIDs, are also available!
Another enhancement is additional documentation for Cognito custom auth challenges.
Parameters
A minor enhancement but important for sensitive parameters that cannot be cached. You can now use force_fetch=True
parameter to always fetch the latest from your preferred parameter provider be that Parameter Store, Secrets Manager, AppConfig, DynamoDB, or your own.
We have also refreshed Parameters documentation using the new Getting started vs Advanced, including surfacing how you can control in-memory cache TTL for parameters retrieved.
Idempotency
Besides error handling improvements, thanks to @Dunedan and @michaelbrewer (#318), you can now reuse a single DynamoDB table to store idempotency state. All new idempotency states stored in your DynamoDB table, as part of this release, will now contain your function name as a prefix for the hash key.
This is one step forward towards GA for Idempotency - The last missing feature before it's GA is allowing an exception callback mechanism so you can handle any exceptions to more easily return custom responses for event sources like API Gateway, AppSync, etc.
πNew features and non-breaking changes
- feat(parameters): Add force_fetch option (#341) by @michaelbrewer
- feat(data-classes): Add appsync scalar_types_utils and add support for timezone offsets (#339) by @michaelbrewer
- feat(idempotent): Include function name in the idempotent key (#326) by @michaelbrewer
- feat(data-classes): AppSync Resolver Event (#323) by @michaelbrewer
- feat(logging): Add correlation_id support (#321) by @michaelbrewer
- feat(logging): Include exception_name (#320) by @michaelbrewer
π Documentation updates
- docs: surface new 1.12.0 features and enhancements (#344) by @heitorlessa
- docs(data-classes): Add more cognito code examples (#340) by @michaelbrewer
- docs: Correct code examples (#317) by @michaelbrewer
- docs(metrics): Correct code examples in markdown (#316) by @michaelbrewer
- docs(metrics): Corrections to the docstrings code examples (#314) by @michaelbrewer
- docs(idempotency): Correct examples and line highlights (#312) by @michaelbrewer
π Bug and hot fixes
- docs(tracer): Fix Tracer typing hinting for Pycharm (#345) by @michaelbrewer
- fix(idempotency): TypeError when calling is_missing_idempotency_key with an int (#315) by @michaelbrewer
- fix(idempotency): Correctly handle save_inprogress errors (#313) by @michaelbrewer
Internal
- refactor(parameters): Consistently reference env (#319) by @michaelbrewer