mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
c7fe6b9160
The CLI config can be written in both native HCL and HCL JSON syntaxes, so the provider_installation block must be expressible using JSON too. Our previous checks to approximate HCL 2-level strictness were too strict for HCL JSON where things are more ambiguous even in HCL 2, so this includes some additional relaxations if we detect that we're decoding an AST produced from a JSON file. This is still subject to the quirky ways HCL 1 handles JSON though, so the JSON value must be structured in a way that doesn't trigger HCL's heuristics that try to guess what is a block and what is an attribute. (This is the issue that HCL 2 fixes by always decoding using a schema; there's more context on this in: https://log.martinatkins.me/2019/04/25/hcl-json/ )
20 lines
448 B
JSON
20 lines
448 B
JSON
{
|
|
"provider_installation": {
|
|
"filesystem_mirror": [{
|
|
"path": "/tmp/example1",
|
|
"include": ["example.com/*/*"]
|
|
}],
|
|
"network_mirror": [{
|
|
"url": "https://tf-Mirror.example.com/",
|
|
"include": ["registry.terraform.io/*/*"],
|
|
"exclude": ["registry.Terraform.io/foobar/*"]
|
|
}],
|
|
"filesystem_mirror": [{
|
|
"path": "/tmp/example2"
|
|
}],
|
|
"direct": [{
|
|
"exclude": ["example.com/*/*"]
|
|
}]
|
|
}
|
|
}
|