While working with terraform lambda modules, I had a hard time finding out the best repository architecture to automate my lambdas deployment. I couldn’t find any article that I could use as a guideline, that’s why I’m writing this article.

While working on big projects, project organization is a must-have. In this story, you will be presented to one way to organize your repositories so that it facilitates the deployment procedure, making it much more scalable.

In this article, we’ll be building the following repositories architecture:

  • Lambda-Module: Repository containing the Terraform Lambda module.
  • Lambda-Infra: Repository containing Terraform code for deployment into AWS.
  • Lambda-Code: Repository containing the lambda code for deployment using Gitlab-CI.

Lambda Module

As defined by HashiCorp:

A module is a container for multiple resources that are used together.

Using terraform modules solve problems like organize configuration, encapsulate configuration, re-use configuration and it provides consistency and ensure best practice.

We’ll be using an AWS lambda module that can be found in here. I won’t go into details of how to build a lambda module, since it isn’t the main goal of this article.

#aws #lambda #gitlab #terraform

Automating Lambda modules deployment with GitLab CI
6.10 GEEK