Live data from Hacker News

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

blog.sourcerer.io

1–10 of 43 posts

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

#4
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 packaging and deployment is cleaner and simpler.

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

#5
Nice guide.

Going through the motions of setting up my first API Gateway and Lambda was eye opening to me.

There are a ton of options in these two services — rate limiting, authorizers, concurrency, monitoring, etc. — that point to how much power you gain building an app like this.

If you’d like to see an automated, infrastructure-as-code approach to setting up an API, check out my boilerplate app:

https://github.com/nzoschke/gofaas

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

#6
post #3

Great introduction! It should probably also include integration with Route53 and Amazon's SSL cert manager.

can you recommend a beginner friendly resource for those?

I personally consider the introductory blog post to be pretty straightforward: https://aws.amazon.com/blogs/aws/new-aws-certificate-manager...

If you're using AWS based services it does a good job of doing what letsencrypt would otherwise do.

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

#7
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 note there are few ways (query strings, headers, parameters, cache enabled only on single method etc.) to specify how to cache responses.

* Attach your REST API on custom domain as a regional endpoint (instead of edge-optimized, since regional endpoints are more configurable)- create ACM certificate (per each region, and one for CloudFront), create own CloudFront distribution (think: multi region deployment), add DNS record in Route53 and configure WAF (some magic DDoS protection).

I took me a lot of time with CloudFormation to get through where I am today and yet I think I would be grateful if someone will share his knowledge gained on more sophisticated use-cases than just 'Hello World'.

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

#8

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…

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.

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

#9
post #8

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…

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 documentation of some product. Well.. It'd definitely made my day if I will see such endpoint in i.e. Stripe docs. Everyone uses short like address like api.example.com so there is definitely use for custom domain name as a feature of API Gateway. Custom domains allows you to separate an API by base paths (i.e. Transactions API, Notifications API, Refunds API) and it easier to upgrade/shutdown... basically maintain your API. Also if you are interested from requests made in two AWS regions and you also care about latency regional endpoints might be way better. Of course, if you will use it with WAF and CloudFront you have a lot of things to configure, which for some companies might be important.

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

#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.

Post reply on HN