Live data from Hacker News

Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

blog.sourcerer.io

11–20 of 43 posts

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#11
post #8

Earlier quoted context omitted.

Ok given all these does it make sense to use AWS Lambda and AWS API Gateway? Does not sound like it will save you time.

Basically, caching allows you to cut your costs if you do it right. Also it is worth to note after 12 months API Gateway stops being free and caching may decrease amount on your bill. However, caching cluster is paid on hourly-basis and you must know if it will be worth to use it. Personally, I don't imagine to provide aaaaaaaaa.execute-api.eu-west-1.amazonaws.com/v1/transactions/XXXX/cancel as a API endpoint in the…

All very valid points

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#12

Is there a use case for AWS API Gateway if one is not using Lambda ? Can it protect a web application against DDOS ? I am not convinced API gateway+ Lambda can substitute for a Web Application , atleast for J2EE apps. The Lambda "boot" time is way too high unless we resort to tricks to keep the lambda instance active. I find the extra $30 or similar is well spent on a a AWS Elastic Beanstalk with auto scaling. The pa…

Might AWS Lambda behind AWS API Gateway (with caching, burst and rate limiting, custom authorizers) behind AWS CloudFront behind AWS WAF and/or CloudFlare work for you?

What is your issue with keeping Lambda instance alive? They mostly stay in standby mode some minutes to keep listening for requests and then it will shutdown whether staying idle - what means next request will boot a Lambda function (container?; It usually takes ~1 second), after that time to receive response is approx. ~100ms.

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#13
post #10

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.

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 and AWS Lambda

#14

Is there a use case for AWS API Gateway if one is not using Lambda ? Can it protect a web application against DDOS ? I am not convinced API gateway+ Lambda can substitute for a Web Application , atleast for J2EE apps. The Lambda "boot" time is way too high unless we resort to tricks to keep the lambda instance active. I find the extra $30 or similar is well spent on a a AWS Elastic Beanstalk with auto scaling. The pa…

Yes, you can use API Gateway without lambda. "API Gateway" is an industry term and not specific to Amazon. The point is exactly your line of reasoning, a funnel/gateway to your APIs. You can handle Auth, Throttling, etc at that point. AWS does provide other products for use against DDOS, WAF, Shield. ELB, Cloudfront, VPCs/SG. Their idea is to be able to scale, deflect if possible and absorb the attack. They also mention that with AWS API Gateway you can get Layer & & 3 DDOS protection and throttling for your backend. I've no practical experience nor have read any reports on how it holds up.

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#15
post #10

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.

This sounds terrific, thanks for the tip!

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#16
post #10

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.

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 i…

+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 and AWS Lambda

#17

I am not sure if 'Full Guide' in title of the article made me smiling or maybe it was recall of my experiences related to configuration of AWS Lambda and AWS API Gateway in CloudFormation. There is a lot of things which has not been mentioned in this article and it is what I am looking forward to - even trivial things which looks easy at the first glance, i.e.: * How to configure caching and caching rules - please no…

I'm using AWS SAM, which simplifies much, but couldn't setup CORS with it.

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#18

Is there a use case for AWS API Gateway if one is not using Lambda ? Can it protect a web application against DDOS ? I am not convinced API gateway+ Lambda can substitute for a Web Application , atleast for J2EE apps. The Lambda "boot" time is way too high unless we resort to tricks to keep the lambda instance active. I find the extra $30 or similar is well spent on a a AWS Elastic Beanstalk with auto scaling. The pa…

It provides a fixed contract to the outside world that is independent of your code-level infrastructure so both parties(provider and consumer) are required to conform to it as an integration. In that sense I find it a compelling thing.

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#20
post #10

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.

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 i…

I went for AWS SAM, but it's still lacking behind Serverless.
Post reply on HN