Closed michaelsync closed 4 years ago
Hi @michaelsync !
main.tf
is copied and modified in two different folders (prod, stage) because there is no better mechanism available in Terraform which allows keeping code DRY'er, and also that file may be different for various environments (eg, version of modules, inputs).
Such size of infrastructure often leads to introducing another higher-level orchestration tool (eg, terragrunt) where main.tf
is simplified and less repetitive.
I am trying to find the best practice for the Terraform folder structure. I found this page https://www.terraform-best-practices.com/examples/terraform/medium-size-infrastructure.
But I don't understand why it's the best practice to have the exact copy of mains in two different folders (prod, stage). Maybe I might be missing something. Please let me know what I miss. Thanks.