Lifehack: How to develop serverless applications faster right on AWS Lambdas without any local environments (instructions)

I develop with Python/Django and this way is much faster rather than use Docker to develop a project locally regarding the time which is needed for auto-reload after you make changes.

It’s very useful for REST API, WebSockets, and background tasks, because you can develop something, it would be uploaded and you can call it right away

Here is an instruction:

  1. Create a project with Serverless or with any other similar framework or infrastructure as a code solution
  2. Configure and connect EFS to your Lambdas (you need to put your Lambdas into VPC to do it)
  3. Mount this EFS on your local computer as a folder
  4. Configure your project to use the EFS folder as a source of the code
  5. Configure your IDE (for example PyCharm) to upload code to the EFS folder as soon as you make any changes
  6. It’s done. As soon as you make any changes, the source code on your Lambdas would be updated automatically

If your Lambdas cached code and you need to wait for the next cold start - then just put a rule into your IDE to run command aws lambda update-function-configuration --function-name --image-config Command="/mnt/efs/app/wsgi_handler.handler" (edit name of your path) as soon as you made changes to your code as well

It’s 100% not for production, just for development purposes