After my first steps with Lambda, Zappa and Flask I created some small applications to try various Zappa configuration options and play with some AWS services. Setting up the project got pretty boring after the second or third toy project. But for python developers there is a solution to automate these tasks – cookiecutter.
I created a cookiecutter template to easily and quickly create a new project, that can be deployed on AWS Lambda and uses Flask along with some other goodies. Checkout the README and the Pipfile.
Here is a short video that demostrates how to use cookiecutter-flask-lambda and create, deploy and undeploy a new project. It won’t get any easier to deploy your Flask based web application.
Zappa and Flask-S3 take care of all the heavy lifting of deploying to AWS Lambda. We can focus on creating the web application.
Image credit: Luke Loughead. Shared under the Creative Commons Attribution-ShareAlike 2.0 Generic license.
Update: After receiving some feedback, that it is not obvious if you need to use Python 2 or 3 for this article, I decided, that I want to update it all the way for Python 3. AWS Lambda supports it, Zappa supports it and we all want Python 3!
I wanted to try out AWS Lambda for a while now. But it took some time to find a reasonable development task that fits this infrastructure. Serverless deployment is very intriguing, escpecially for someone like me that doesn’t enjoy to fiddle with servers, operating systems and stuff.
No, I won’t reveal any detals about my project yet. But I want to share my experiences building a simple webapp – the good old hello world example – and deploy it on AWS Lambda.
Honestly, Hammerspoon is an awesome tool to automate your macOS computer. It can react to system events, keyboard shortcuts and much more. Just have a look at its API and the Getting Started Guide. It is made for people that are not afraid to use an editor and code in the sweet programming language Lua. If you can code, it is more then sufficient to take a look at Learn Lua in Y Minutes to get a good grasp of Lua.
I could successfully replace 5 tools (Caffeine, Moom, Keyboard Maestro and Browserism) with a single script, that works much better and is way slimmer then these tools.