Re:AWS Lambda and .zip is a recipe for serverless success
by dev1n on Sunday March 18, 2018 @12:47PM
(#16612801)
API Gateway is the literal manifestation of the worst product I have ever had the misfortune of configuring. This is mostly due to AWS's incompetence at delivering any semblance of working documentation around the product. Looking forward to their new "open source" documentation.
[ Parent
| on HN ]
Re:AWS Lambda and .zip is a recipe for serverless success
by nzoschke on Sunday March 18, 2018 @02:50PM
(#16613550)
Check out the Serverless Application Model (SAM): https://github.com/awslabs/serverless-application-model
All of the manual configuration of API gateway vanishes because it builds up an implicit API gateway from your functions and event mapping config.
You can see a boilerplate SAM config here: https://github.com/nzoschke/gofaas/blob/master/template.yml
I'm hacking on CORS today and with SAM it's 2 lines of config to add the allowed origins and methods.
Re:AWS Lambda and .zip is a recipe for serverless success
by dev1n on Sunday March 18, 2018 @02:54PM
(#16613578)
I have just finished up using SAM and it is miles better than trying to wire API Gateway and Lambda together. Setting up an authorizer with cognito took some time to find the right examples and get the swagger right but yes I am a fan of SAM.
While we're on the subject, Cloudformation could definitely use some work too. AWS, please tell me what line the template failed at. We had to use the swagger extensions to integrate cognito and those were failing because of indentation errors, but it just kept complaining about invalid swagger 2.0 definitions. That is just so gross.
Re:AWS Lambda and .zip is a recipe for serverless success
by Shoothe on Sunday March 18, 2018 @01:24PM
(#16612997)
I can second this. I wanted to write a simple provisioning tool a while ago that sets up HTTP endpoint on API Gateway and forwards the call to Lambda and the process was extremely complicated.