I want to pass a string value to a module in terraform, and have the module render it based on the variables defined in the module. Something like
module "test" {
source = "./test"
template = "This is a templated string ${var.user}"
user = "Bob"
}
But I don't want the template string evaluated until it's inside the module. Is there an easy way to either prevent template rendering, or force template rendering again once inside the module?
Things I've considered thus far:
- the
templatefilefunction. The string isn't coming from a file, and isn't really designed to come from a file. - The
formatorreplacefunctions. While they will probably work, it feels like a square peg round hole solution, where I'm forcing things.