Skip to content

Instantly share code, notes, and snippets.

@w3bward
Created March 18, 2022 19:07
Show Gist options
  • Save w3bward/130e436e2d731de05c6f3bf2fa03ccb5 to your computer and use it in GitHub Desktop.
Save w3bward/130e436e2d731de05c6f3bf2fa03ccb5 to your computer and use it in GitHub Desktop.
This is why not to use string interpolation...
terraform {
required_version = ">= 1.1.6"
}
locals {
my_var = "12\" = 1'"
}
resource "null_resource" "bad_example" {
triggers = {
my_var = local.my_var
always_run = "${timestamp()}"
}
provisioner "local-exec" {
interpreter = ["Powershell", "-Command"]
command = <<EOC
write-host "my_var value: ${local.my_var}"
EOC
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment