How to set up a Terraform GitOps Project using Terragrunt and GitLab Pipelines
<h1>Introduction</h1>
<p>GitOps is a process for automating cloud deployment using Git, infrastructure-as-code, and CI/CD tools. Your code repository will be the single source of truth for your infrastructure. At any point in time, your infrastructure-as-code configuration will <em>mirror </em>the existing infrastructure in the cloud. GitOps reduces the effort of installing infrastructure tools and running multiple deployment commands locally, and replaces that with a single <em>git push </em>or a merge request. Afterward, your CI/CD tool will take over and deploy the infrastructure while you sit back and monitor the deployment job.</p>
<p>The use of CI/CD tools such as <a href="https://gitlab.com/" rel="noopener ugc nofollow" target="_blank">GitLab</a> provides the additional advantage of keeping your repository DRY <em>(don’t repeat yourself)</em>. That is, using GitLab’s ephemeral runners removes any auto-generated files by the infrastructure-as-code tool during runtime. Once the GitLab job is completed, the auto-generated files will be discarded by the short-lived ephemeral runner. An Example of auto-generated files is the lock file generated by <a href="https://www.terraform.io/" rel="noopener ugc nofollow" target="_blank">Terraform</a> and the <em>backend.tf</em> and <em>provider.</em></p>
<p><a href="https://medium.com/nerd-for-tech/gitops-terraform-project-setup-using-terragrunt-and-gitlab-pipelines-b6b0be4b9b32"><strong>Website</strong></a></p>