-
Notifications
You must be signed in to change notification settings - Fork 429
feat(event_sources): add support for VPC Lattice events #2358
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
Merged
leandrodamascena
merged 17 commits into
aws-powertools:develop
from
stephenbawks:vpclattice
Jun 8, 2023
Merged
Changes from 9 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e6c6e69
vpc lattice event type
stephenbawks 306efc6
adding to init
stephenbawks c742470
fixing import name
stephenbawks 7d3b1f9
adding load test event
stephenbawks d53d6a6
fixing the host
stephenbawks 8ae8382
updating documentation
stephenbawks d57a500
spelling
stephenbawks 9d41a8d
Merge branch 'develop' into vpclattice
stephenbawks ab5c1c4
missed a link
stephenbawks 8043d39
Merge branch 'develop' into vpclattice
leandrodamascena 86aa432
added properties
stephenbawks 71e9043
Merge branch 'awslabs:develop' into vpclattice
stephenbawks 07310a5
test
stephenbawks 9cf1ddc
Merge branch 'develop' into vpclattice
heitorlessa 75c4ef7
chore: tests + coverage + documentation
leandrodamascena 0c208f2
chore: documentation
leandrodamascena 68fd363
Merge branch 'develop' into vpclattice
leandrodamascena File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
aws_lambda_powertools/utilities/data_classes/vpc_lattice.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from typing import Dict | ||
|
||
from aws_lambda_powertools.utilities.data_classes.common import ( | ||
DictWrapper, | ||
) | ||
|
||
class VPCLatticeEvent(DictWrapper): | ||
@property | ||
def body(self) -> str: | ||
"""The VPC Lattice body.""" | ||
return self["body"] | ||
|
||
@property | ||
def headers(self) -> Dict[str, str]: | ||
"""The VPC Lattice event headers.""" | ||
return self["headers"] | ||
|
||
@property | ||
def is_base64_encoded(self) -> bool: | ||
"""A boolean flag to indicate if the applicable request payload is Base64-encode""" | ||
return self["is_base64_encoded"] | ||
|
||
@property | ||
def method(self) -> str: | ||
"""The VPC Lattice method used. Valid values include: DELETE, GET, HEAD, OPTIONS, PATCH, POST, and PUT.""" | ||
return self["method"] | ||
|
||
@property | ||
def query_string_parameters(self) -> Dict[str, str]: | ||
"""The request query string parameters.""" | ||
return self["query_string_parameters"] | ||
|
||
@property | ||
def raw_path(self) -> str: | ||
"""The raw VPC Lattice request path.""" | ||
return self["raw_path"] |
leandrodamascena marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"raw_path": "/testpath", | ||
"method": "GET", | ||
"headers": { | ||
"user_agent": "curl/7.64.1", | ||
"x-forwarded-for": "10.213.229.10", | ||
"host": "test-lambda-service-3908sdf9u3u.dkfjd93.vpc-lattice-svcs.us-east-2.on.aws", | ||
"accept": "*/*" | ||
}, | ||
"query_string_parameters": {}, | ||
"body": "", | ||
"is_base64_encoded": false | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.