I have a question about the terraform modules. Is it possible to have a condition set in the source while using terraform modules?
example:
module "infra_deployment" {
source = (local.region == "SFO" ? ./modules/SFO_repo : ./modules/standard_repo)
something here
}
With pure Terraform this is not possible but can do this with Terragrunt by using generate to conditionally generate the module definition:
https://terragrunt.gruntwork.io/docs/reference/config-blocks-and-attributes/#generate