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&nbsp;<em>mirror&nbsp;</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&nbsp;<em>git push&nbsp;</em>or a merge request. Afterward, your CI/CD tool will take over and deploy the infrastructure while you sit back &nbsp;and monitor the deployment job.</p> <p>The use of CI/CD tools such as&nbsp;<a href="https://gitlab.com/" rel="noopener ugc nofollow" target="_blank">GitLab</a>&nbsp;provides the additional advantage of keeping your repository DRY&nbsp;<em>(don&rsquo;t repeat yourself)</em>. That is, using GitLab&rsquo;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&nbsp;<a href="https://www.terraform.io/" rel="noopener ugc nofollow" target="_blank">Terraform</a>&nbsp;and the&nbsp;<em>backend.tf</em>&nbsp;and&nbsp;<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>