Loading...
Loading...
### Terraform Version ```shell Terraform v1.11.3 on darwin_arm64 + provider registry.terraform.io/hashicorp/local v2.5.2 ``` ### Terraform Configuration Files ```terraform locals { foo = { abc = 2 bcd = "some string" cde = false } bar = {} a = true } resource "local_file" "test_good" { filename = "/tmp/test-good.json" content = local.a ? jsonencode(local.foo) : jsonencode(local.bar) } resource "local_file" "test_bad" { filename = "/tmp/test-bad.json" content = jsonencode(local.a ? local.foo : local.bar) } ``` ### Debug Output ``` ...debug output, or link to a gist... ``` ### Expected Behavior I'd expect the two local files created by this terraform to be identical, with the different data types correctly quoted. The /tmp/test-good.json is correct, it contains: `{"abc":2,"bcd":"some string","cde":false}` ### Actual Behavior the second file created (/tmp/test-bad.json) has all data types converted to strings, it contains: `{"abc":"2","bcd":"some string","cde":"false"}` ### Steps to Reproduce 1.` terraform init` 2. `terraform apply` 3. `diff /tmp/test-*.json` ### Additional Context I run terraform under tenv, other than that no exotic config ### References not that I could find ### Generative AI / LLM assisted development? n/a, all a result of this humans work
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.