https://github.com/ditsuke/terraform-bad-json
Stop yourself from breaking your CI pipelines with this terraform gotcha
https://github.com/ditsuke/terraform-bad-json
terraform
Last synced: 3 months ago
JSON representation
Stop yourself from breaking your CI pipelines with this terraform gotcha
- Host: GitHub
- URL: https://github.com/ditsuke/terraform-bad-json
- Owner: ditsuke
- Created: 2022-11-04T11:43:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-04T11:51:46.000Z (over 2 years ago)
- Last Synced: 2025-01-02T00:11:06.850Z (5 months ago)
- Topics: terraform
- Language: HCL
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Broken JSON in Terraform
This repo is a minimum reproducible example of invalid JSON strings introduced through the
use of templates in terraform. It does so by rendering a templatized JSON with a variable
and then trying to decode it to a terraform native object.If the JSON has an unsanitized value, terraform is unable to decode it.
To test, run `terraform init` to initialize terraform state and providers, followed by a
`terraform plan --var 'VAL=good'` to see it work, then a `terraform plan --var 'VAL="bad'` to
see it fail because of an unsanitized value in the JSON.