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(parser): add support to VpcLatticeModel #2584

Merged

Conversation

leandrodamascena
Copy link
Contributor

Issue number: #2579

Summary

Changes

Use case:
Customers can integrate VPC Lattice with Lambda and might need to parser events using Pydantic.

Changes:
This pull request introduces support to the VPCLatticeModel and envelope.

User experience

import pytest

from aws_lambda_powertools.utilities.parser import (
    event_parser,
)
from aws_lambda_powertools.utilities.parser.models import VPCLatticeModel
from aws_lambda_powertools.utilities.typing import LambdaContext
from aws_lambda_powertools import Logger

logger = Logger()

@event_parser(model=VPCLatticeModel)
def handle_lambda_vpclattice_with_envelope(event: VPCLatticeModel, context: LambdaContext):
    logger.info(event.raw_path)

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.

@leandrodamascena leandrodamascena requested a review from a team as a code owner June 27, 2023 10:59
@boring-cyborg boring-cyborg bot added documentation Improvements or additions to documentation tests labels Jun 27, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 27, 2023
@github-actions github-actions bot added the feature New feature or functionality label Jun 27, 2023
@rubenfonseca rubenfonseca linked an issue Jun 27, 2023 that may be closed by this pull request
2 tasks
@rubenfonseca rubenfonseca self-assigned this Jun 27, 2023
@rubenfonseca rubenfonseca added the parser Parser (Pydantic) utility label Jun 27, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (fea3f6a) 97.21% compared to head (f1c2abd) 97.22%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2584   +/-   ##
========================================
  Coverage    97.21%   97.22%           
========================================
  Files          158      160    +2     
  Lines         7370     7394   +24     
  Branches       537      537           
========================================
+ Hits          7165     7189   +24     
  Misses         158      158           
  Partials        47       47           
Impacted Files Coverage Δ
..._powertools/utilities/parser/envelopes/__init__.py 100.00% <100.00%> (ø)
...wertools/utilities/parser/envelopes/vpc_lattice.py 100.00% <100.00%> (ø)
...bda_powertools/utilities/parser/models/__init__.py 100.00% <100.00%> (ø)
..._powertools/utilities/parser/models/vpc_lattice.py 100.00% <100.00%> (ø)

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

Copy link
Contributor

@rubenfonseca rubenfonseca left a comment

Choose a reason for hiding this comment

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

Thanks Leandro for the quick turn-around! Just left two small comments. What do you think?

leandrodamascena and others added 2 commits June 27, 2023 13:45
Co-authored-by: Ruben Fonseca <fonseka@gmail.com>
Signed-off-by: Leandro Damascena <lcdama@amazon.pt>
Co-authored-by: Ruben Fonseca <fonseka@gmail.com>
Signed-off-by: Leandro Damascena <lcdama@amazon.pt>
@leandrodamascena
Copy link
Contributor Author

leandrodamascena commented Jun 27, 2023

Thanks Leandro for the quick turn-around! Just left two small comments. What do you think?

I agree 100%, Ruben! All of them were addressed.

@rubenfonseca rubenfonseca changed the title feat(parser): add support to VPCLatticeModel feat(parser): add support to VpcLatticeModel Jun 27, 2023
Copy link
Contributor

@rubenfonseca rubenfonseca left a comment

Choose a reason for hiding this comment

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

🎉

@rubenfonseca rubenfonseca merged commit 1931584 into aws-powertools:develop Jun 27, 2023
rafaelgsr pushed a commit to rafaelgsr/aws-lambda-powertools-python that referenced this pull request Jun 30, 2023
Co-authored-by: Ruben Fonseca <rubefons@amazon.com>
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 feature New feature or functionality parser Parser (Pydantic) utility 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.

Feature request: add event envelope and parser model for VPC Lattice
3 participants