How do we select or disable modules in root main.tf
Example:
module "foo" {
source = "bar"
count = "${var.include_module ? 1 : 0}"
}
Above one does not work, as per terraform issue discussion link
Any alternate method ?
What version of Terraform are you using? count
and for_each
for modules were introduced in Terraform version 0.13.0.
Note that the interpolation syntax you're using is deprecated. Use:
count = var.include_module ? 1 : 0