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.
This site uses WP YouTube Lyte to embed YouTube video’s. The thumbnails are loaded from YouTube servers, but those are not tracked by YouTube (no cookies are being set). Upon clicking on the play button however, YouTube can and will collect information about you.
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.
Continue reading First Steps with AWS Lambda, Zappa, Flask and Python 3