mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-02-17 10:01:05 -05:00
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"]
}
55 lines
1.9 KiB
JSON
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"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|