Bug: API Gateway Console Test button fails validation with @parser envelope ApiGatewayEnvelope because requestContext -> identity -> sourceIp value is not a valid IPv4 or IPv6 network #2526
Labels
bug
Something isn't working
parser
This item relates to the Parser Utility
pending-release
This item has been merged and will be released soon
Expected Behavior
We should be able to generate a test form the API Gateway console that allows the ApiGatewayProxyEventModel to be validated and parsed by Zod.
Current Behavior
When generating a test from the API Gateway console, the value for the sourceIp in requestContext -> identity is "test-invoke-source-ip". Since this value is defined to be an ip here And so test events from the API Gateway console fail with a 502 error because of the resulting Zod ValidationError.
Code snippet
Steps to Reproduce
/upload
route in the Api Gateway AWS Consolefollowing conversation in the Discord: https://discord.com/channels/1006478942305263677/1006527385409179678/1239877018653560872
(related to aws-powertools/powertools-lambda-python/issues/1562)
Possible Solution
update the Api Gateway zod schema to be:
Powertools for AWS Lambda (TypeScript) version
2.1.1-beta
AWS Lambda function runtime
20.x
Packaging format used
npm
Execution logs
No response
The text was updated successfully, but these errors were encountered: