Terraform — Using Private Git Repo As Module Source and Run through pipeline

<p>U<strong><em>se Case Explanation:</em></strong></p> <ol> <li><strong><em>If your organization has placed the Terraform generic modules in a different(centralised) private repository, and you want to refer those private repository module in your terraform code then follow this article.</em></strong></li> <li><strong><em>In this article, we will see, how you can refer the Terraform module from the private git repo. My focus will be to discuss on&nbsp;</em></strong><code>HTTPS</code><strong><em>method for referring the module from central repository.</em></strong></li> <li><strong><em>I will show how we can authenticate to private git repository using</em></strong><code>Git Personal Access Token</code><strong><em>method. This method can be used in the Terraform infra deployment pipeline.</em></strong></li> </ol> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:611/1*-4VV-jHrGRrc98X06EJDyw.png" style="height:311px; width:611px" /></p> <h2><strong>Assumptions:</strong></h2> <ol> <li>You already have private git repo where you have placed generic terraform modules.</li> <li>Your pipeline slave/worker container/machine has&nbsp;<strong>terraform&nbsp;</strong>and&nbsp;<strong>git&nbsp;</strong>installed. (Terraform Infra Automated Deployment)</li> </ol> <p><a href="https://medium.com/@dipandergoyal/terraform-using-private-git-repo-as-module-source-d20d8cec7c5"><strong>Learn More</strong></a></p>
Tags: private Git