Managing multiple environments with Terraform and GitLab CI
Jun 14, 2023Sophia Manicor

Summary
This post introduces a method for managing multiple infrastructure environments (dev, staging, production) within a single Terraform project using GitLab CI. It details a file structure with environment-specific folders, environment-specific `.gitlab-ci.yml` files that trigger based on file changes within their respective directories, and a shared `helper.yml` for common Terraform jobs (fmt, validate, plan, build, deploy, destroy). It also outlines a merge request workflow for promoting changes through environments.