NSE 7 – Public Cloud Security 7.2 — Question 12
Your goal is to deploy resources in multiple places and regions in the public cloud using Terraform.
What is the most efficient way to deploy resources without changing much of the Terraform code?
Answer options
- A. Use the Variable.tf file and edit its values to match multiple resources.
- B. Use Ansible and terraform output values to deploy resources.
- C. Use multiple terraform.tfvars files with a variables.tf file.
- D. Use the provider.tf file to add all the new values.
Correct answer: C
Explanation
Using multiple terraform.tfvars files allows you to maintain separate configurations for different environments or regions while keeping the main Terraform configurations unchanged. This method is efficient as it promotes reusability of code and simplifies management. The other options either involve more manual changes or do not directly support the efficient deployment of resources across multiple regions.