GitLab CI and Distributed Builds
Managing multiple environments with Terraform and GitLab CI

Managing multiple environments with Terraform and GitLab CI

6/14/2023 · Sophia Manicor

What this post added

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.

Read the original post ↗