Terraform output of embedded multiline string joining new lines in output

Viewed 1208

I'm using this resource with a here string:

resource "datadog_monitor" "test" {
  name = "test"
  type = "metric alert"

  message = <<EOF
  {{#is_alert}}
  aaaaaaaaa
  {{/is_alert}}

  {{#is_warning}}
  bbbbbbbb
  {{/is_warning}}

  {{#is_recovery}}
  cccccccc
  {{/is_recovery}}
EOF
....

When I run plan it puts it all on one line

+ resource "datadog_monitor" "test" {
      + evaluation_delay    = 900
      + id                  = (known after apply)
      + include_tags        = true
      + locked              = false
      + message             = "{{#is_alert}}\n aaaaa\n aaaaa\n {{/is_alert}}\n\n  {{#is_warning}}\n    bbbbbbbb\n  {{/is_warning}}\n\n  {{#is_recovery}}\n  cccccccc\n  {{/is_recovery}}\n
      ......

Is there a way to have output for "message" be multiline instead of all on one line so its easier to read?

1 Answers

I know this is an old question but in case anyone looking for an answer to that question:

Use EOT (embedded opentype) not EOF (end of file)

Related