Issue: When using “GET”, API Gateway works with Lambda and DynamoDB using a stage’s Invoke URL but does not work with custom domain
The following error is thrown when using a custom domain with API GateWay when called with curl.
curl -X GET -H “x-api-key: your-key-here” -H “Content-Type: application/json” https://maxsecure.com/api?TableName=myTable
[ERROR] TypeError: scan() argument after ** must be a mapping, not NoneType
Traceback (most recent call last):
File “/var/task/lambda_function.py”, line 40, in lambda_handler
return respond(None, operations[operation](dynamo, payload))
File “/var/task/lambda_function.py”, line 32, in
‘GET’: lambda dynamo, x: dynamo.scan(**x),
Resolution:
From the CloudFront Manager “Behaviors” tab of the custom domain, set the behavior of the Query String Forwarding option to “Forward all …” as shown below.
Recent Comments