3 ms·
I found a way to make Terraform code completely dry by using Hiera as a data source and writing every stack and module to be entirely data-driven (ie: only ever
by raffraffraff 4y ago
I found a way to make Terraform code completely dry by using Hiera as a data source and writing every stack and module to be entirely data-driven (ie: only ever use "for_each" to iterate over a data map, never hard code anything, use strict naming conventions). However there are some major obstacles to using Terraform this way, that emerge from it being a clunky DSL with hidden "special rules", instead of behaving in a consistent way like a proper language. Like these:
https://github.com/hashicorp/terraform/issues/31072 https://github.com/hashicorp/terraform/issues/31072
https://github.com/hashicorp/terraform/issues/24476 https://github.com/hashicorp/terraform/issues/24476