terraform icon indicating copy to clipboard operation
terraform copied to clipboard

yamldecode fails on strings of only + (upstream go-cty-yaml issue)

Open TBeijen opened this issue 1 year ago • 0 comments

Terraform Version

Terraform v1.6.6
on darwin_arm64

Terraform Configuration Files

locals {
  yaml_inline_sample_error = <<-EOT
          element: +
          some_list:
          - foo
          - +
        EOT
}

output "yaml_decode_test" {
  value = yamldecode(local.yaml_inline_sample_error)
}

Debug Output

Trace omitted. Shows nothing related to yamldecode and issue is in upstream library.

Expected Behavior

String + decoded as string

Actual Behavior

Error:

│ Error: Error in function call
│
│   on main.tf line 45, in output "yaml_decode_test":
│   45:   value = yamldecode(local.yaml_inline_sample_error)
│     ├────────────────
│     │ while calling yamldecode(src)
│     │ local.yaml_inline_sample_error is "element: +\nsome_list:\n- foo\n- +\n"
│
│ Call to function "yamldecode" failed: cannot parse "+" as tag:yaml.org,2002:int.

Steps to Reproduce

terraform init
terraform plan

Additional Context

No response

References

Issue is in https://github.com/zclconf/go-cty-yaml/issues/13

Once fixed upstream, pacakage should be bumped.

(Not sure if there's automation bumping any pacakage, therefore created this bug issue)

TBeijen avatar Feb 03 '24 12:02 TBeijen