dependabot / dependabot/dependabot-core
Terraform JSON Syntax is not supported
- Dominant language
- Ruby
- Stars
- 5.8k
- Forks
- 1.5k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 149
Description
[Terraform also supports an alternative syntax that is JSON-compatible](https://www.terraform.io/docs/language/syntax/json.html). Terraform expects native syntax for files named with a .tf suffix, and JSON syntax for files named with a .tf.json suffix.
However, this syntax is not supported by dependabot. As an example:
```json
{
"module": [
{
"kernel": [
{
"source": "git::https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git?ref=v5.0"
}
]
}
]
}
```
is a simple terraform module in JSON syntax that should get upgraded. I've tried both `.json`, and `.tf.json` extensions: https://github.com/captn3m0/dependabot-github-test/tree/main/json, but it doesn't get picked up. However, the plain `.tf` syntax does: https://github.com/captn3m0/dependabot-github-test/blob/main/kernel/main.tf (PR at https://github.com/captn3m0/dependabot-github-test/pull/7)
Contributor guide
Research direction
Start by reproducing the issue with the linked dependabot-github-test examples, comparing the .tf and .tf.json module files and the existing upgrade PR. Trace how Dependabot discovers and parses Terraform manifests; done means the JSON-syntax module is picked up and its dependency can be upgraded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- terraform
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100