github aws-powertools/powertools-lambda-python v2.15.0

latest releases: v2.40.1, v2.40.0, v2.39.1...
14 months ago

Summary

This release is packed with a number of improvements:

  • New external provider formats in Logger
  • New Parser models and JMESPath expressions to naturally process S3 Event Notifications targets
  • Printing Event Source Data Classes now automatically mask sensitive data
  • New flush_metrics in Metrics to support customers using Lambda Web Adapter
  • Added support for the China and GovCloud regions in API Gateway Authorizer event (bugfix)

And… a ton of documentation improvements.

⭐ Huge thanks to new contributors: @theipster (S3 events), @neilramsay (Data Class debug), @arjanschaaf (Batch docs) and @leif-ye (API Gateway Event Source)

External provider formats in the Logger utility

Docs: Observability providers

You can now send logs to the observability provider of your choice via Lambda Extensions. In most cases, you shouldn't need any custom Logger configuration, and logs will be shipped asynchronously with no performance impact.
image

Improved S3 Event Notifications developer experience

Docs: Built-in envelopes, Parser

S3 event notifications can be sometimes be ingested into Lambda via an intermediary such as an SQS queue (i.e. Lambda event source), for various architectural reasons - batching, retries, etc. However, from the Lambda function's perspective, the intermediary might not be too important; what's important is the S3 event notification itself. Now you can easily parse and access the inner payload for SQS-wrapper S3 events.

JMESPath

carbon (2)

Parser

carbon (3)

Printing Event Source Data Classes

Docs: Debugging

You can now print out the fields of a data class instance to obtain more information. All classes come with a __str__ method that generates a dictionary string which can be quite useful for debugging. Sensitive fields such as secret_access_key and session_token, are labeled as [SENSITIVE], to prevent any accidental disclosure of confidential information.

carbon (4)

Flushing metrics manually

Docs: Flushing metrics manually

You can now manually flush the metrics at any time. This is useful when not running within a standard Lambda handler (e.g: Lambda Web Adapter), where the @log_metrics decorator does not work as intended.

image

Changes

🌟New features and non-breaking changes

  • feat(event_source): support custom json_deserializer; add json_body in SQSEvent (#2200) by @leandrodamascena
  • feat(parser): add support for SQS-wrapped S3 event notifications (#2108) by @theipster
  • feat(logger): add DatadogLogFormatter and observability provider (#2183) by @heitorlessa
  • feat(jmespath): new built-in envelopes to unwrap S3 events (#2169) by @leandrodamascena
  • feat(event_source): add support for dynamic partitions in the Api Gateway Authorizer event (#2176) by @leif-ye
  • feat(metrics): add flush_metrics() method to allow manual flushing of metrics (#2171) by @rubenfonseca
  • feat(event_sources): Add str to Data Classes base DictWrapper (#2129) by @neilramsay
  • feat(ci): dispatch GitHub analytics action (#2161) by @rubenfonseca

📜 Documentation updates

🔧 Maintenance

This release was made possible by the following contributors:

@arjanschaaf, @dependabot, @dependabot[bot], @heitorlessa, @leandrodamascena, @leif-ye, @neilramsay, @rubenfonseca, @theipster and Release bot

Don't miss a new powertools-lambda-python release

NewReleases is sending notifications on new releases.