News for hackers. Stuff that matters.
Re:Full Guide to Developing REST API’s with AWS API Gateway ... by Mizza on Monday May 14, 2018 @10:12AM (#17065672)
Alternately:

``` from flask import Flask app=Flask() @app.route(‘/‘) def hi(): return "Hi!” ```

$ pip install zappa

$ zappa init

$ zappa deploy

$ zappa certify

IAM, SSL, API Gateway, Lambda, all taken care of. We did the work so you don't have to.

Re:Full Guide to Developing REST API’s with AWS API Gateway ... by Lord_Zero on Monday May 14, 2018 @10:30AM (#17065843)
If using NodeJS there is a very similar package to zappa called Serverless https://serverless.com/

One thing I would improve with the authors article is he crammed a giant conditional statement on the http-method inside his one function. Serverless makes it easy to bundle a single function per HTTP method and even share common code between them. You can build out a whole application as a single npm package.

Bonuses include plugins for serverless that let you unit test your handlers, run a simulated APIG/Lambda/Dynamo environment locally for development, plugins that let you interact more deeply with AWS like assigning a custom domain to your APIG.

Example apps: https://github.com/serverless/examples

Re:Full Guide to Developing REST API’s with AWS API Gateway ... by dschep on Monday May 14, 2018 @04:03PM (#17068955)
Serverless Framework is also great for Python if you're not porting a WSGI application. Plug/Disclaimer: I'm the creator/maintainer of the defacto python dependency packaging plugin for serverless[0]

[0] https://github.com/UnitedIncome/serverless-python-requiremen...

Re:Full Guide to Developing REST API’s with AWS API Gateway ... by bbrock25 on Monday May 14, 2018 @10:49AM (#17066001)
+1 for serverless. Have also used it extensively for building python applications on AWS lambda.
Re:Full Guide to Developing REST API’s with AWS API Gateway ... by Terr_ on Monday May 14, 2018 @12:37PM (#17066896)
I'm currently working on a project where -- in serverless.yml -- a single API gateway path for all HTTP methods leads to a Flask app... largely because this scheme seems much much easier and faster to test and develop locally.

Are there any particular benefits to exporting and reimplementing all of that routing and organizational logic into instructions that "program" the API Gateway instead?

In this particular case, the API is solely for external consumption by a third party

Re:Full Guide to Developing REST API’s with AWS API Gateway ... by k__ on Monday May 14, 2018 @11:17AM (#17066222)
I went for AWS SAM, but it's still lacking behind Serverless.
Re:Full Guide to Developing REST API’s with AWS API Gateway ... by pweissbrod on Monday May 14, 2018 @11:46AM (#17066457)
To me, the beautiful thing about this zappa approach is that I still follow the spec of a UWSGI-compliant app and I get the benefit of quick deployment to lambda without any form of vendor lock-in as it is also straightforward to plug the same app into, say nginx, without code change.
Re:Full Guide to Developing REST API’s with AWS API Gateway ... by dfee on Monday May 14, 2018 @11:30AM (#17066319)
What is the group thought on running these containers that have access to (for example) a Postgres or Redis dB?

Sure Zappa, keeps the “container-function-thing” alive so you can cache it as a global variable, but this is a jacket approach that I’m not clear enough on the consequences to use.

Re:Full Guide to Developing REST API’s with AWS API Gateway ... by cavisne on Monday May 14, 2018 @07:36PM (#17070380)
The most obvious limitation is the scale out concurrency model of lambda (serial requests within a container). This is great for simplicity but means you can’t have a connection pool.

Something like dynamo db is a better fit if it works for you, otherwise most people seem to be forced to run a few servers with pgbouncer

Re:Full Guide to Developing REST API’s with AWS API Gateway ... by creeble on Monday May 14, 2018 @10:48AM (#17065989)
This sounds terrific, thanks for the tip!