Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7917 +/- ##
========================================
Coverage 96.63% 96.63%
========================================
Files 284 284
Lines 14105 14105
Branches 1162 1162
========================================
Hits 13630 13630
Misses 345 345
Partials 130 130 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| ### Parameters | ||
|
|
||
| Parameters utility works correctly, but be aware that **cache is per-process**. |
There was a problem hiding this comment.
| Parameters utility works correctly, but be aware that **cache is per-process**. | |
| Parameters utility works as expected, but be aware that **caching is per-process**. |
examples/lambda_features/durable_functions/src/best_practice_metrics.py
Outdated
Show resolved
Hide resolved
examples/lambda_features/durable_functions/src/best_practice_logging.py
Outdated
Show resolved
Hide resolved
examples/lambda_features/durable_functions/src/using_metrics.py
Outdated
Show resolved
Hide resolved
examples/lambda_features/durable_functions/src/using_parameters.py
Outdated
Show resolved
Hide resolved
examples/lambda_features/managed_instances/src/database_connections.py
Outdated
Show resolved
Hide resolved
dreamorosi
left a comment
There was a problem hiding this comment.
Left a few comments, great work so far, thanks for leading the way
|
Thanks everyone for the feedback! I'm addressing all of them and need some time to finish. |
|
@leandrodamascena Any updates on the above? Would be great to have documentation on durable function support |
|
Hey @kishaningithub! We are working to merge this. |
|
|
||
| ### Use Idempotency for ESM triggers | ||
|
|
||
| When your durable function is triggered by Event Source Mappings (SQS, Kinesis, DynamoDB Streams), use the `@idempotent` decorator to protect against duplicate invocations. |
There was a problem hiding this comment.
I think with this example it could be good to call out that the ordering of decorators matters.
We should use @idempotency always on top of @durable_exection, right?
|
|
||
|
|
||
| @durable_execution | ||
| def handler(event: dict, context: DurableContext) -> str: |
There was a problem hiding this comment.
Question: Do need to add @logger.inject_lambda_context here?
|
|
||
| @tracer.capture_lambda_handler | ||
| @durable_execution | ||
| def handler(event: dict, context: DurableContext) -> str: |
There was a problem hiding this comment.
Same comment regarding @logger.inject_lambda_context. Is this needed here?
|
|
||
| The `@idempotent` decorator integrates with Durable Functions and is **replay-aware**. It's useful for protecting the Lambda handler entry point, especially for Event Source Mapping (ESM) invocations like SQS, Kinesis, or DynamoDB Streams. | ||
|
|
||
| ```python hl_lines="9 15" title="Using Idempotency with Durable Functions" |
There was a problem hiding this comment.
| ```python hl_lines="9 15" title="Using Idempotency with Durable Functions" | |
| ```python hl_lines="8 15" title="Using Idempotency with Durable Functions" |







Issue number: closes #7915
Summary
This PR adds documentation for two new Lambda features: Lambda Managed Instances and Durable Functions.
Changes
I created a new
lambda-featuressection in the docs with two pages:Lambda Managed Instances
Durable Functions
context.set_logger()The idea here is to create those pages as integration guides, not feature documentation. They follow a different structure than core utilities because:
1/ The focus is "how Powertools works with X" rather than "how to use Powertools feature Y"
2/ Current customers that users Powertools should find guidance on Powertools compatibility with those new features
3/ The content is more about considerations and gotchas than step-by-step tutorials
User experience
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.