Description
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 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.
Acknowledgment
- This request meets Powertools for AWS Lambda (Python) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET
Metadata
Metadata
Assignees
Type
Projects
Status