TERRAFORM MODULES – COMPLETE INTERVIEW Q&A
🟢 BEGINNER LEVEL 1. What is a Terraform module? Answer: A Terraform module is a reusable set of Terraform configuration files that defines infrastructure resources. It allows us to write code once...

Source: DEV Community
🟢 BEGINNER LEVEL 1. What is a Terraform module? Answer: A Terraform module is a reusable set of Terraform configuration files that defines infrastructure resources. It allows us to write code once and reuse it across multiple environments or teams. 2. What problem do modules solve? Answer: Modules solve: code duplication lack of standardization maintenance complexity Without modules, teams copy-paste the same resources. With modules, we follow the DRY principle (Don’t Repeat Yourself). 3. What is the DRY principle? Answer: DRY means: Do not repeat the same logic multiple times. In Terraform, modules implement DRY by allowing reusable infrastructure code. 4. What is a root module? Answer: The root module is the main Terraform configuration where we run commands like: terraform init terraform apply It calls other modules. 5. What is a child module? Answer: A child module is any module that is called from another module (usually the root module). 6. How do you call a module? Answer: modu