I am trying to use the local-exec
provisioner and I have a long command that I would like to make multiline for readability sakes but I am having trouble doing so
using an az cli command as an example, I currently am doing this:
provisioner "local-exec" {
command = "az iot hub routing-endpoint create --endpoint-resource-group ${} --endpoint-name ${} --endpoint-subscription-id ${} --endpoint-type eventhub --hub-name ${} --auth-type identitybased --identity ${} --endpoint-uri ${} --entity-path ${}"
}
But I would like to use something like this
provisioner "local-exec" {
command = <<EOD
az iot hub routing-endpoint create
--endpoint-resource-group ${} \
--endpoint-name ${} \
--endpoint-subscription-id ${} \
--endpoint-type eventhub \
--hub-name ${} \
--auth-type identitybased \
--identity ${} \
--endpoint-uri ${} \
--entity-path ${} \
EOD
}
but it complains about the backslash and if i don’t use the backslash, it tries to run every new line as its own command
Has anyone gotten around this?