Files
opentf/internal/command/testdata/show-json-state/modules/output.json
Alisdair McDiarmid 12c8f9498c json-output: Add output type to JSON format
Previously the supported JSON plan and state formats included only
serialized output values, which was a lossy serialization of the
Terraform type system. This commit adds a type field in the usual cty
JSON format, which allows reconstitution of the original value.

For example, previously a list(string) and a set(string) containing the
same values were indistinguishable. This change serializes these as
follows:

{
  "value": ["a","b","c"],
  "type": ["list","string"]
}

and:

{
  "value": ["a","b","c"],
  "type": ["set","string"]
}
2022-04-27 13:30:15 -04:00

55 lines
1.9 KiB
JSON

{
"format_version": "1.0",
"terraform_version": "0.12.0",
"values": {
"outputs": {
"test": {
"sensitive": false,
"type": "string",
"value": "baz"
}
},
"root_module": {
"child_modules": [
{
"resources": [
{
"address": "module.module_test_bar.test_instance.example",
"mode": "managed",
"type": "test_instance",
"name": "example",
"provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0,
"values": {
"ami": "bar-var",
"id": null
},
"sensitive_values": {}
}
],
"address": "module.module_test_bar"
},
{
"resources": [
{
"address": "module.module_test_foo.test_instance.example[0]",
"mode": "managed",
"type": "test_instance",
"name": "example",
"index": 0,
"provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0,
"values": {
"ami": "foo-var",
"id": null
},
"sensitive_values": {}
}
],
"address": "module.module_test_foo"
}
]
}
}
}