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?
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.
Benefits of This Approach
Reusability:
Your core configuration files (main.tf, variables.tf) stay the same.
Only the .tfvars files need to change for different regions or environments.
Scalability:
Want to add a new region? Simply create a new .tfvars file—no need to modify existing code.
Flexibility:
You can easily switch between environments or regions without rewriting the code.
Consistency:
By defining variables in one place (variables.tf), you reduce the risk of errors and duplication.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
rac_sp
4 months, 1 week agorac_sp
4 months, 1 week agojhonnyjhon
6 months, 3 weeks ago