Skip to content

Releases: aws-powertools/powertools-lambda-python

v1.26.7

29 Jul 14:09
160feae
Compare
Choose a tag to compare

Summary

This release adds a change to the idempotency utility, expiring in-progress executions if the Lambda function times out halfway through.

The new feature requires no code changes. However, if you're using just the idempotent_function decorator, you will want to register the Lambda context on your handler to take advantage of this feature:

To prevent against extended failed retries when a Lambda function times out, Powertools now calculates and includes the remaining invocation available time as part of the idempotency record. If a second invocation happens after this timestamp, and the record is marked as INPROGRESS, we will execute the invocation again as if it was in the EXPIRED state (e.g, expire_seconds field elapsed).

We also enabled static analysis (mypy) on the new statically typed documentation snippets - big thanks to @VictorCovalski for spotting one issue in Event Handler that later led to 50 other fixes.

Oh! Did I also tell you we’ve got a new full time maintainer? Big welcome to Ruben 😉 https://twitter.com/rubenfonseca

Changes

🌟New features and non-breaking changes

  • feat(idempotency): handle lambda timeout scenarios for INPROGRESS records (#1387) by @rubenfonseca

📜 Documentation updates

🐛 Bug and hot fixes

  • fix(event_handlers): ImportError when importing Response from top-level event_handler (#1388) by @VictorCovalski

🔧 Maintenance

This release was made possible by the following contributors:

@VictorCovalski, @dependabot, @dependabot[bot], @heitorlessa, @rubenfonseca and Release bot

v1.26.6

25 Jul 11:47
7414df7
Compare
Choose a tag to compare

Third-time is the luck of the Irish (new security release mechanisms)

Summary

This patch release addresses an internal issue for Event Handler REST API compression feature when headers value is None -- Huge thanks for spotting and fixing it as a first-time contributor @tbuatois!!

We now have public Lambda Layers deployed across all AWS commercial regions (22) - stellar multi-month work by @am29d. We have one last work to complete before we share the additional ARNs with everyone -- automate documentation generation for every Layer Version::Region mapping.

image

Lastly on Operational Excellence, we've implemented further security layers for GitHub Actions following GitHub's Hardening Guide, and created a Maintenance Issue template to make tech debt work more visible to all customers and future maintainers.

Changes

🐛 Bug and hot fixes

  • fix(event_handlers): handle lack of headers when using auto-compression feature (#1325) by @tbuatois

🔧 Maintenance

This release was made possible by the following contributors:

@am29d, @dependabot, @dependabot[bot], @heitorlessa, @tbuatois and Release bot

v1.26.5

20 Jul 07:11
43bd38b
Compare
Choose a tag to compare

Summary

This patch release addresses a packaging regression that introduced mypy boto3 typing packages as prod dependencies instead of dev dependencies -- huge thanks to @tb102122 for spotting this 30m ago.

Everything else in this release is related to operational excellence on improving GitHub Actions workflow performance, and last steps to make our new Lambda Layer release pipeline ready.

Changes

🐛 Bug and hot fixes

  • fix(deps): correct mypy types as dev dependency (#1322) by @heitorlessa
  • fix(ci): keep layer version permission resource (#1318) by @am29d
  • fix(ci): lambda layer workflow release version and conditionals (#1316) by @am29d
  • fix(ci): remove additional quotes in PR action (#1317) by @heitorlessa
  • fix(ci): install poetry before calling setup/python with cache (#1315) by @rubenfonseca

🔧 Maintenance

  • fix(deps): correct mypy types as dev dependency (#1322) by @heitorlessa
  • fix(ci): lambda layer workflow release version and conditionals (#1316) by @am29d
  • chore(ci): adds caching when installing python dependencies (#1311) by @rubenfonseca

This release was made possible by the following contributors:

@am29d, @dependabot[bot], @heitorlessa, @rubenfonseca and Release bot

v1.26.4

18 Jul 11:39
29c2403
Compare
Choose a tag to compare

Summary

This release continues our focus on Operational Excellence with several GitHub Actions to improve our automation on governance tasks (e.g., PR labelling, security, release automation, dependencies, etc.).

We also moved the Lambda Layer release pipeline to Github Actions (#1278). This will expand the official Lambda Layer to all commercial AWS regions, once operational. Huge thanks to @am29d!

In addition, we laid the groundwork for end-to-end (E2E) testing, starting with the core features (logger, metrics, tracer). Thank you @mploski!

Changes

🐛 Bug and hot fixes

  • fix(parser): raise ValidationError when SNS->SQS keys are intentionally missing (#1299) by @rubenfonseca
  • fix(ci): fixes typos and small issues on github scripts (#1302) by @rubenfonseca

🔧 Maintenance

This release was made possible by the following contributors:

@am29d, @dependabot, @dependabot[bot], @heitorlessa, @mploski and @rubenfonseca

v1.26.3

04 Jul 12:06
daf6e03
Compare
Choose a tag to compare

Summary

This patch release addresses an issue with Lambda handlers with custom signatures (*args, **kwargs) when using logger.inject_lambda_context decorator - thanks to @RonRandemaker

Thanks to @kbakk, we now have officially documented how to inject standard logging record attributes when using Logger.

This release continues our focus on Operational Excellence with several GitHub Actions to improve our automation on governance tasks (e.g., PR labeling, Comments on issues closed, Markdown linting rules etc.).

Last but not least, we've started revamping all documentation examples, including making some of them more realistic to how customers would code.

image

Ah! Before I forget...huge thanks to new contributors @RonRademaker, @kbakk.

Changes

📜 Documentation updates

🐛 Bug and hot fixes

  • fix(logger): preserve std keys when using custom formatters (#1264) by @heitorlessa
  • fix(logger): support additional args for handlers when injecting lambda context (#1276) by @RonRademaker

🔧 Maintenance

This release was made possible by the following contributors:

@RonRademaker, @dependabot, @dependabot[bot], @heitorlessa and @kbakk

v1.26.2

16 Jun 14:25
8ce0455
Compare
Choose a tag to compare

Summary

This release addresses CORS Pre-flight issue when using Event Handler with ALB. Prior to this release, ALB would return HTTP 502 if Lambda would return a null body for a Pre-flight (HTTP OPTIONS) request. This release sets body to an empty string for compliance, and it doesn't affect API Gateway/AppSync features.

Shoutout to @francispeabody for spotting this behaviour, as CORS Specification doesn't dictate whether there should be a response or not leaving to each service to make their own judgement.

Changes

🐛 Bug and hot fixes

  • fix(event-handler): body to empty string in CORS preflight (ALB non-compliant) (#1249) by @heitorlessa

🔧 Maintenance

  • chore(deps): bump actions/setup-python from 3 to 4 (#1244) by @dependabot
  • chore(deps-dev): bump mypy-boto3-appconfig from 1.23.0.post1 to 1.24.0 (#1233) by @dependabot
  • chore(deps-dev): bump mypy-boto3-dynamodb from 1.23.0.post1 to 1.24.0 (#1234) by @dependabot
  • chore(deps-dev): bump mypy-boto3-secretsmanager from 1.23.8 to 1.24.0 (#1232) by @dependabot
  • chore(deps-dev): bump mypy-boto3-ssm from 1.23.0.post1 to 1.24.0 (#1231) by @dependabot
  • chore(deps-dev): bump mypy from 0.960 to 0.961 (#1241) by @dependabot
  • chore(metrics): revert dimensions test and split (#1243) by @heitorlessa

This release was made possible by the following contributors:

@am29d, @dependabot, @dependabot[bot] and @heitorlessa

v1.26.1

07 Jun 14:50
9d8dd1b
Compare
Choose a tag to compare

Summary

This is an emergency release to ensure Metrics utility raises an exception when customers add 9 user-defined metric dimensions.

Huge thanks to @dnlopes for spotting this bug thus warranting this emergency release.

Background

Lambda Powertools adds a service CloudWatch Metric Dimension on top of user-defined dimensions (max 8). Prior to this release, customers were able to add 9 user-defined dimensions leading to a total of 10 metric dimensions. This makes CloudWatch EMF fail silently and not convert them as metrics.

The confusion stems from CloudWatch Metrics and CloudWatch Logs EMF having different limits. CloudWatch Metrics support 10 dimensions while CloudWatch EMF (async) support 9. For EMF, all validation must happen client side as EMF fails silently should any limit is hit and no feedback is given.

We provided this feedback to the CloudWatch EMF team, and they're looking at ways to improve customers feedback on the server-side so it's less reliant on client-side validation.

Changes

📜 Documentation updates

🐛 Bug and hot fixes

  • fix(metrics): raise SchemaValidationError for >8 metric dimensions (#1240) by @heitorlessa

🔧 Maintenance

This release was made possible by the following contributors:

@dependabot, @dependabot[bot] and @heitorlessa

v1.26.0

20 May 07:58
0704670
Compare
Choose a tag to compare

Summary

This release unblocks customers using Parameters utility when trying to use VPC private endpoints, or looking to bring their own boto3 clients to ease testing, custom settings, etc.

Documentation

User Experience

image

As part of this release, we've made progress on a few governance topics such as a new dedicated board of activities and our first iteration of the new roadmap process - you can read more details on our current pause message update.

image

image

Changes

🌟New features and non-breaking changes

  • feat(parameters): accept boto3_client to support private endpoints and ease testing (#1096) by @ran-isenberg

📜 Documentation updates

🐛 Bug and hot fixes

  • fix(docs): remove Slack link (#1210) by @sthulb
  • fix(batch): missing space in BatchProcessingError message (#1201) by @mew1033
  • fix(batch): docstring fix for success_handler() record parameter (#1202) by @peterschutt

🔧 Maintenance

  • chore(deps-dev): bump mypy-boto3-secretsmanager from 1.21.34 to 1.23.0.post1 (#1218) by @dependabot
  • chore(deps-dev): bump mypy-boto3-appconfig from 1.21.34 to 1.23.0.post1 (#1219) by @dependabot
  • chore(deps-dev): bump mypy-boto3-ssm from 1.21.34 to 1.23.0.post1 (#1220) by @dependabot
  • chore(deps): bump pydantic from 1.9.0 to 1.9.1 (#1221) by @dependabot
  • feat(parameters): accept boto3_client to support private endpoints and ease testing (#1096) by @ran-isenberg
  • chore(deps): bump email-validator from 1.1.3 to 1.2.1 (#1199) by @dependabot

This release was made possible by the following contributors:

@dependabot, @dependabot[bot], @heitorlessa, @mew1033, @peterschutt, @ran-isenberg and @sthulb

v1.25.10

29 Apr 15:36
8ca082f
Compare
Choose a tag to compare

Summary

This patch release addresses the following main issues:

  • Event Handler: Previously, Lambda handlers decorated with event source data class that also use Event Handler were incompatible
  • Event Handler: Raising a ServiceError like NotFound as part of an exception handler ended up propagating a ServiceError instead of converting into a non-successful response (e.g., 4xx)
  • Event Source Data Classes: Missing date field type annotation in SESEvent to string instead of list, and missing fields like cc, bcc, sender, and reply_to, and dkim related fields
  • Parameters: Previously, customers couldn't easily clear parameters (SSM, Secrets Manager, AppConfig, DynamoDB) cache as part of their automated tests

image

Changes

🌟 New features and non-breaking changes

🐛 Bug and hot fixes

  • fix(data-classes): fix SES date field typing and add missing fields (#1045) by @michaelbrewer
  • fix(deps-dev): remove jmespath due to dev deps conflict (#1148) by @sthulb
  • fix(deps): ignore boto3 updates until needed (#1151) by @sthulb
  • fix(event_handler): allow event source data class events (#1159) by @michaelbrewer
  • fix(event_handler): exception_handler to handle ServiceError exceptions (#1160) by @michaelbrewer

🔧 Maintenance

  • chore(deps-dev): bump flake8-bugbear from 22.1.11 to 22.4.25 (#1156) by @dependabot
  • chore(deps-dev): bump mypy from 0.942 to 0.950 (#1162) by @dependabot
  • chore(deps-dev): bump flake8-eradicate from 1.2.0 to 1.2.1 (#1158) by @dependabot
  • chore(deps): bump github/codeql-action from 1 to 2 (#1154) by @dependabot
  • chore(ci): disable mergify configuration after breaking changes (#1188) by @heitorlessa
  • fix(deps): ignore boto3 updates until needed (#1151) by @sthulb
  • chore(deps-dev): bump mkdocs-git-revision-date-plugin from 0.3.1 to 0.3.2 (#1146) by @dependabot
  • chore(deps): bump codecov/codecov-action from 3.0.0 to 3.1.0 (#1143) by @dependabot
  • chore(deps-dev): bump xenon from 0.8.0 to 0.9.0 (#1145) by @dependabot
  • chore(deps-dev): bump mypy from 0.931 to 0.942 (#1133) by @dependabot
  • fix(deps-dev): remove jmespath due to dev deps conflict (#1148) by @sthulb

This release was made possible by the following contributors:

@dependabot, @dependabot[bot], @heitorlessa, @huonw, @michaelbrewer, and @sthulb

v1.25.9

21 Apr 12:53
134da8e
Compare
Choose a tag to compare

Summary

Quick patch release to fix jmespath pip marker to exact Python 3.6 version to address conflict in later versions.

Changes

🐛 Bug and hot fixes

  • fix(deps): correct py36 marker for jmespath

This release was made possible by the following contributors:

@dependabot[bot], @heitorlessa and @mergify[bot]