Terraform modules
Terraform modules are reusable, repeatable templates. They allow abstraction in provisioning infrastructure, which is much needed if your usage grows beyond just some proof of concept. HashiCorp visualizes modules as designed by experts who know the enterprise standard and used by developers who want to apply the enterprise standard infrastructure in their projects. That way, things are standard across the organization. It saves developers time and avoids duplication of efforts. Modules can be versioned and distributed using a module repository or through your version control. That provides infrastructure admins with an ample amount of power and control at the same time.
As we created a resource group in the last section, let’s modularize that in the next exercise. To access the resources for this section, cd
into the following:
$ cd ~/modern-devops/ch8/terraform-modules/
Within this directory, we have the following directory structure:
. ├...