4 ms·
Amen. Last Sunday morning, I was so excited to move my APIs over to AWS’s API Gateway. That evening, I was ready to kill. I spent the entire day (9+ hrs) get
by ac360 11y ago
Amen.
Last Sunday morning, I was so excited to move my APIs over to AWS’s API Gateway. That evening, I was ready to kill.
I spent the entire day (9+ hrs) getting merely two API routes working. A GET and a dreaded POST request.
I couldn’t tell from your post if you eventually figured it out, but it is possible to get the POST request body and url params in your Lambda event as JSON.
In my POST Method’s Integration Request, here’s how I get the query string parameter and the request body. I use this Input Mapping.
#set($inputRoot = $input.path('$'))
{
"access_token":"$input.params('access_token')",
"name" : "$inputRoot.name",
“email” : "$inputRoot.email”
}
A “glass half full” way to think about all of this is that the AWS API Gateway is ridiculously strict about what data can be passed in to your Lambda functions, and you must explicitly state that data.
Here are other problems I ran into over the weekend:
- The web console is super buggy with broken links and really, really bad UX.
- The documentation is missing for many essential components.
- No support for API Gateway in the AWS SDKs
- I can't figure out how to copy resource methods, so I have to do tons of redundant manual input when creating each resource method, which includes explicitly stating every HTTP Error response code.
- Returning error objects from Lambda functions also needs mapping.
- Out-of-the-box slow response times. My Lambda function with two simple DynamoDB queries often takes 3 seconds to return a result when its route is hit.
Overall, I'm a huge AWS fanboy but the execution of this product is incomplete and out of touch.
C'mon AWS, you can pull through on this. Keep it simple. Build out from there. We all want you to succeed.
- ac360 11y agoUPDATE: They just announced a nice fix for easily getting the request JSON Body into your Lambda functions and some documentation improvements. See jeffbar's post in this thread.