Is there a way to store multiple lines of bash commands into a variable? I’ve not found any examples of how to do this anywhere and have failed to come up with it on my own so far.
use case - i’m trying to use a null_resource to call provisioner “local-exec” and then pass in multiple commands. i can do this using <<EOT if i do it directly in the null_resource itself, but if i try to put the commands into a variable, terraform will fail on PLAN or APPLY because it “failed to load root config module, error parsing (path/variables.tf)” with illegal characters usually as the reason.
i’d like to be able to create a couple of different variables with different commands, then do a lookup in the actual null_resource to call the proper variable based on my lookup criteria. i just am struggling to figure out how to pass in multiple lines via a variable. Any help would be appreciated.