Using a private Git repository for sharing a Terraform module
In this chapter dedicated to Terraform modules, we have seen that it is possible to put the code of a module in a GitHub repository to publish it in the Terraform public registry.
However, in companies of any size, there is a need to create modules without exposing the code of these modules publicly in GitHub repositories, that is, making it accessible to everyone.
What you need to know is that there are several types of Terraform module sources, as indicated in this documentation: https://www.terraform.io/docs/modules/sources.html.
In this recipe, we will study how to expose a Terraform module through a private Git repository. Either this Git server is installed internally (so-called on-premises) or on the cloud, i.e., SaaS, but requires authentication to access the repository.
Getting ready
For this recipe, we will use a Git repository in Azure Repos (Azure DevOps), which is free and requires authentication...