You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
API Gateway (REST, HTTP), ALB, Lambda Function URL, and VPC Lattice unfortunately have differences in the payload. This leads to having nearly the same functionality in Event Source Data Classes to work around these differences and limitations.
These will eventually lead to a drift in implementation, making it harder to debug.
Within aws_lambda_powertools/utilities/data_classes/common.py, we could have standalone functions like get_header_value, and create new ones to handle JSON and Base64 deserialization.
This means updating code in several places where we might have HTTP Headers, HTTP Query Strings, HTTP JSON payload, Base64 payload -- SNS, SQS, Kinesis, API Gateway, AppSync, etc.
Why is this needed?
API Gateway (REST, HTTP), ALB, Lambda Function URL, and VPC Lattice unfortunately have differences in the payload. This leads to having nearly the same functionality in Event Source Data Classes to work around these differences and limitations.
These will eventually lead to a drift in implementation, making it harder to debug.
Latest example: https://github.com/awslabs/aws-lambda-powertools-python/pull/2358/files#diff-209f210ae09d053ce73d291e9f7b3869015b7f592f186be386518f152aa497adR56
Which area does this relate to?
Event Source Data Classes
Suggestion
Within
aws_lambda_powertools/utilities/data_classes/common.py
, we could have standalone functions likeget_header_value
, and create new ones to handle JSON and Base64 deserialization.This means updating code in several places where we might have HTTP Headers, HTTP Query Strings, HTTP JSON payload, Base64 payload -- SNS, SQS, Kinesis, API Gateway, AppSync, etc.
Acknowledgment
The text was updated successfully, but these errors were encountered: