Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(event_sources): support for S3 Event Notifications through EventBridge #2024

Conversation

ivica-k
Copy link
Contributor

@ivica-k ivica-k commented Mar 20, 2023

Issue number:
#1656

Summary

Changes

adds dataclasses/events support for S3 event notifications through EventBridge

Note: Pay special attention to me overriding mypy checks with # type: ignore[override]

User experience

    from aws_lambda_powertools.utilities.data_classes import event_source, S3EventBridgeNotificationEvent

    @event_source(data_class=S3EventBridgeNotificationEvent)
    def lambda_handler(event: S3EventBridgeNotificationEvent, context):
        bucket_name = event.detail.bucket.name
        file_key = event.detail.object.key

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

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.

@ivica-k ivica-k requested a review from a team as a code owner March 20, 2023 16:31
@ivica-k ivica-k requested review from rubenfonseca and removed request for a team March 20, 2023 16:31
@boring-cyborg boring-cyborg bot added documentation Improvements or additions to documentation tests labels Mar 20, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 20, 2023
@heitorlessa
Copy link
Contributor

Looking

@heitorlessa heitorlessa requested review from heitorlessa and removed request for rubenfonseca March 20, 2023 16:32
@github-actions github-actions bot added the feature New feature or functionality label Mar 20, 2023
@boring-cyborg boring-cyborg bot added dependencies Pull requests that update a dependency file internal Maintenance changes labels Mar 20, 2023
@heitorlessa heitorlessa force-pushed the feat(data-classes)-1656-s3-event-eventbridge-dataclass branch from f227cc6 to 83e4d58 Compare March 20, 2023 17:19
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 97.87% and project coverage change: +0.01 🎉

Comparison is base (da87606) 97.44% compared to head (378415d) 97.46%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2024      +/-   ##
===========================================
+ Coverage    97.44%   97.46%   +0.01%     
===========================================
  Files          146      146              
  Lines         6660     6749      +89     
  Branches       478      478              
===========================================
+ Hits          6490     6578      +88     
- Misses         134      135       +1     
  Partials        36       36              
Impacted Files Coverage Δ
...mbda_powertools/utilities/data_classes/s3_event.py 98.81% <96.77%> (-1.19%) ⬇️
...mbda_powertools/utilities/data_classes/__init__.py 100.00% <100.00%> (ø)
...wertools/utilities/data_classes/active_mq_event.py 100.00% <100.00%> (ø)
...bda_powertools/utilities/parser/models/__init__.py 100.00% <100.00%> (ø)
...powertools/utilities/parser/models/event_bridge.py 100.00% <100.00%> (ø)
...ws_lambda_powertools/utilities/parser/models/s3.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@heitorlessa heitorlessa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outstanding PR @ivica-k - I liked the attention to traceable testing errors via ids in parametrized tests, and the use of .get() in assertion to make parametrized possible.

THANK YOU!

@heitorlessa heitorlessa changed the title feat(data-classes): adds support for S3 event notifications through EventBridge feat(event_sources): support for S3 Event Notifications through EventBridge Mar 20, 2023
@heitorlessa heitorlessa merged commit 92b1c7a into aws-powertools:develop Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation feature New feature or functionality internal Maintenance changes size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants