4 ms·
Have you written anything about this, or can you point me to any resources that might help me avoid pitfalls? I'd appreciate it!
by mojoe 10y ago
Have you written anything about this, or can you point me to any resources that might help me avoid pitfalls? I'd appreciate it!
- balls187 10y agoSadly, no I haven't written anything. (if my comments are any indication--I kinda suck as a writer). The biggest pains are: * Mapping parameters in API Gateway * Setting the IAM Roles for API Gateway & Lambda (the latter is required to provide execution for API Gateway) * Setting up custom domains for your API (it uses cloudfront, but must be done via the commandline, and the process kind of sucks) I've done this work now 3 times. Feel free to email me any questions you have: balasuar@gmail.com and I'll be happy to answer, and provide guidance.
- mojoe 10y agoThanks, I may take you up on that down the road!
- MrMullen 10y agoZappa is a Python tool that can be extremely helpful for persons getting into Lambda. It basically handles everything except for code creation (You have to do that). You can make crontab like jobs or a website and then push the code up to Lamba with a single command. It handles all the temporary S3 buckets, IAM account creation, fetching the Lambda URL, uploading code and connecting Lambda to API Gateway. Deployments are super smooth. pip install zappa It supports all of the Languages for Lambda, not just Python.
- mojoe 10y agoI'm glad that tools like this exist, I wasn't aware of them, thanks
- ak217 10y agoTake a look at https://github.com/awslabs/chalice https://github.com/awslabs/chalice. IMO it's better than zappa if you are Python-centric. As you can tell from the name, it strives to be the Lambda-based equivalent of Flask. One tip regarding your workflow: don't pipe data from S3 to Lambda to your client unless you really have to. You can use S3 pre-signed URLs to granularly delegate access to S3 objects for a limited time, then refer your client to them. Even if you are generating the binary content on the fly in your lambda, it's easier to save it to S3 and refer the client to that. That said, if your content is truly too dynamic to live on S3, then gzip+base64 encoding it, serving it in json and decoding/displaying it in javascript should be straightforward.
- mojoe 10y agoI'll check this out, thanks!