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

docs(api_gateway): new event handler for API Gateway and ALB #418

Merged

Conversation

heitorlessa
Copy link
Contributor

@heitorlessa heitorlessa commented May 4, 2021

Issue #, if available:

Description of changes:

Checklist

  • Meet tenets criteria
  • Update tests
  • Update docs
  • PR title follows conventional commit semantics
  • Create Getting Started example
  • Create sample infrastructure for Proxy Event
  • Create Examples section for high level methods
  • Cover correlation ID in the getting started example
  • Cover CORS for prototyping and production
  • Mention CORS on errors like 404
  • Cover integration with Data classes
    • query strings
    • headers, Lambda context
  • Cover use of Response()
  • Cover binary responses
  • Cover GZIP responses
  • Cover Testing
  • Cover FAQ on when we recommend Chalice and fully fledged web frameworks
  • ALB specifics
    • [x] Create sample infrastructure
      • ALB has no support for CloudFormation for Lambda as target
    • Demonstrate how to use ProxyEvent

Minor implementation changes

cc @michaelbrewer

  • Enum to match code style (PascalCase)
  • Keep not found only in message return for security reasons
  • Remove Tuple type of response to keep it simpler (Dict and Response only)
  • Create Example section (docstrings) for routes app.get, app.post, app.delete, etc. to improve DX on IDEs.

Breaking change checklist

RFC issue #:

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

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@heitorlessa heitorlessa added documentation Improvements or additions to documentation area/event_handlers labels May 4, 2021
@heitorlessa heitorlessa added this to the 1.15.0 milestone May 4, 2021
@codecov-commenter
Copy link

codecov-commenter commented May 4, 2021

Codecov Report

Merging #418 (bcdf622) into develop (59b3adf) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #418   +/-   ##
========================================
  Coverage    99.89%   99.89%           
========================================
  Files          101      101           
  Lines         3977     3989   +12     
  Branches       198      197    -1     
========================================
+ Hits          3973     3985   +12     
  Misses           1        1           
  Partials         3        3           
Impacted Files Coverage Δ
aws_lambda_powertools/event_handler/api_gateway.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59b3adf...bcdf622. Read the comment docs.

@heitorlessa
Copy link
Contributor Author

Merging it now @michaelbrewer but I'll wait for your other PR to fix cors=None piece and I'll release it tomorrow morning.

@heitorlessa heitorlessa marked this pull request as ready for review May 5, 2021 19:50
Copy link
Contributor

@michaelbrewer michaelbrewer left a comment

Choose a reason for hiding this comment

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

LGTM. I will look at adding support for cors=None as the default at the route level.

@heitorlessa heitorlessa merged commit d1cd5cb into aws-powertools:develop May 5, 2021
@heitorlessa heitorlessa deleted the docs/event-handler-http branch May 5, 2021 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants