mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06: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"] }
168 lines
3.7 KiB
JSON
168 lines
3.7 KiB
JSON
{
|
|
"format_version": "1.1",
|
|
"terraform_version": "1.2.0-dev",
|
|
"variables": {
|
|
"ami": {
|
|
"value": "bad-ami"
|
|
},
|
|
"id_minimum_length": {
|
|
"value": 10
|
|
}
|
|
},
|
|
"planned_values": {
|
|
"outputs": {
|
|
"foo_id": {
|
|
"sensitive": false,
|
|
"type": "string",
|
|
"value": "placeholder"
|
|
}
|
|
},
|
|
"root_module": {}
|
|
},
|
|
"output_changes": {
|
|
"foo_id": {
|
|
"actions": [
|
|
"create"
|
|
],
|
|
"before": null,
|
|
"after": "placeholder",
|
|
"after_unknown": false,
|
|
"before_sensitive": false,
|
|
"after_sensitive": false
|
|
}
|
|
},
|
|
"prior_state": {
|
|
"format_version": "1.0",
|
|
"terraform_version": "1.1.0",
|
|
"values": {
|
|
"outputs": {
|
|
"foo_id": {
|
|
"sensitive": false,
|
|
"type": "string",
|
|
"value": "placeholder"
|
|
}
|
|
},
|
|
"root_module": {
|
|
"resources": [
|
|
{
|
|
"address": "test_instance.bar",
|
|
"mode": "managed",
|
|
"type": "test_instance",
|
|
"name": "bar",
|
|
"provider_name": "registry.terraform.io/hashicorp/test",
|
|
"schema_version": 0,
|
|
"values": {
|
|
"ami": "ami-test",
|
|
"id": "placeheld",
|
|
"password": null
|
|
},
|
|
"sensitive_values": {}
|
|
},
|
|
{
|
|
"address": "test_instance.foo",
|
|
"mode": "managed",
|
|
"type": "test_instance",
|
|
"name": "foo",
|
|
"provider_name": "registry.terraform.io/hashicorp/test",
|
|
"schema_version": 0,
|
|
"values": {
|
|
"ami": "ami-test",
|
|
"id": "placeholder",
|
|
"password": null
|
|
},
|
|
"sensitive_values": {}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"configuration": {
|
|
"provider_config": {
|
|
"test": {
|
|
"name": "test",
|
|
"full_name": "registry.terraform.io/hashicorp/test"
|
|
}
|
|
},
|
|
"root_module": {
|
|
"outputs": {
|
|
"foo_id": {
|
|
"expression": {
|
|
"references": [
|
|
"test_instance.foo.id",
|
|
"test_instance.foo"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"resources": [
|
|
{
|
|
"address": "test_instance.bar",
|
|
"mode": "managed",
|
|
"type": "test_instance",
|
|
"name": "bar",
|
|
"provider_config_key": "test",
|
|
"expressions": {
|
|
"ami": {
|
|
"constant_value": "ami-boop"
|
|
}
|
|
},
|
|
"schema_version": 0
|
|
},
|
|
{
|
|
"address": "test_instance.foo",
|
|
"mode": "managed",
|
|
"type": "test_instance",
|
|
"name": "foo",
|
|
"provider_config_key": "test",
|
|
"expressions": {
|
|
"ami": {
|
|
"references": [
|
|
"var.ami"
|
|
]
|
|
}
|
|
},
|
|
"schema_version": 0
|
|
}
|
|
],
|
|
"variables": {
|
|
"ami": {
|
|
"default": "ami-test"
|
|
},
|
|
"id_minimum_length": {
|
|
"default": 10
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"relevant_attributes": [
|
|
{
|
|
"resource": "test_instance.foo",
|
|
"attribute": [
|
|
"id"
|
|
]
|
|
}
|
|
],
|
|
"condition_results": [
|
|
{
|
|
"address": "output.foo_id",
|
|
"condition_type": "OutputPrecondition",
|
|
"result": true,
|
|
"unknown": false
|
|
},
|
|
{
|
|
"address": "test_instance.bar",
|
|
"condition_type": "ResourcePostcondition",
|
|
"result": false,
|
|
"unknown": false,
|
|
"error_message": "Resource ID is unacceptably short (9 characters)."
|
|
},
|
|
{
|
|
"address": "test_instance.foo",
|
|
"condition_type": "ResourcePrecondition",
|
|
"result": false,
|
|
"unknown": false,
|
|
"error_message": "Invalid AMI ID: must start with \"ami-\"."
|
|
}
|
|
]
|
|
}
|