AWS Lambda & GitlabCi â Deployment and Database Migrations with ENV Variables for Node.js Application
While working on delivering some features for an application in my daily work me and my team were facing a challenge when trying to automate the deployment of an AWS Lambda function through Gitlab CI.
By definition, the AWS Lambda functions should be a simple and small application serving one purpose and one purpose only.
This was also the case for us but the challenge was that our Lambda function had also a database that we had agreed upon during our planning. We had to store different information, and it was a lot. We couldnât use configuration files since that would have increased the size of the application.
As some of you might know, AWS Lambda functions have some restrictions when it comes to the size of the codebase. If the extracted size of the zipped codebase is more than 128Mb the deployment will fail. This is obviously configurable but we wanted to keep the default configuration when it came to size.