A module is a container for multiple resources that are used together. Modules can be used to create lightweight abstractions, so that you can describe your infrastructure in terms of its architecture, rather than directly in terms of physical objects.
A Terraform module is very simple: any set of Terraform configuration files in a folder is a module.
Create a new folder called modules and move all the files (that is, main.tf, variables.tf, and outputs.tf) from the web server cluster into modules/services/webserver-cluster.
Open up the main.tf file in modules/services/webserver-cluster and remove the provider definition.
Providers should be configured by the user of the module and not by the module itself.
$ tree minimal-module/
- 7 Most Common Mistakes in Python Programming: Student Cheat Sheet - July 14, 2020
- Understanding Kubernetes’s Taints and Tolerations in easy way - July 5, 2020
- Understanding Node Selector and Node Affinity in Kubernetes - July 5, 2020