You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm interested in deployments across multiple cloud providers. By-and-large the TF for these are the same, with some features varying.
I'm particularly interested in being able to write multiple modules that conform to the same interface, with implementations selected on the basis of a variable value.
Attempted Solutions
This is not something that can currently be done within terraform.
Proposal
It'd be great if this would work:
# main.tf
variable "platform" {
type = string
default = "p1"
}
module "m" {
source = "./module/${var.platform}"
x = 10
}
output "y" {
value = module.m.y
}
# module/p1/main.tf
variable "x" {
type = number
}
output "y" {
value = var.x + 1
}
# module/p2/main.tf
variable "x" {
type = number
}
output "y" {
value = var.x * 2
}
I'd be happy with variables / expressions computed from locally-available values (eg, selecting the module to use from a yaml config file).
Thanks for this feature request! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again!
Terraform Version
Use Cases
I'm interested in deployments across multiple cloud providers. By-and-large the TF for these are the same, with some features varying.
I'm particularly interested in being able to write multiple modules that conform to the same interface, with implementations selected on the basis of a variable value.
Attempted Solutions
This is not something that can currently be done within terraform.
Proposal
It'd be great if this would work:
I'd be happy with variables / expressions computed from locally-available values (eg, selecting the module to use from a yaml config file).
References
The text was updated successfully, but these errors were encountered: