mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-04-22 12:02:11 -04:00
Configuration-driven moves are represented in the plan file by setting the resource's `PrevRunAddr` to a different value than its `Addr`. For JSON plan output, we here add a new field to resource changes, `previous_address`, which is present and non-empty only if the resource is planned to be moved. Like the CLI UI, refresh-only plans will include move-only changes in the resource drift JSON output. In normal plan mode, these are elided to avoid redundancy with planned changes.
90 lines
2.7 KiB
JSON
90 lines
2.7 KiB
JSON
{
|
|
"format_version": "0.2",
|
|
"planned_values": {
|
|
"root_module": {
|
|
"resources": [
|
|
{
|
|
"address": "test_instance.baz",
|
|
"mode": "managed",
|
|
"type": "test_instance",
|
|
"name": "baz",
|
|
"provider_name": "registry.terraform.io/hashicorp/test",
|
|
"schema_version": 0,
|
|
"values": {
|
|
"ami": "baz",
|
|
"id": "placeholder"
|
|
},
|
|
"sensitive_values": {}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"resource_changes": [
|
|
{
|
|
"address": "test_instance.baz",
|
|
"mode": "managed",
|
|
"type": "test_instance",
|
|
"previous_address": "test_instance.foo",
|
|
"provider_name": "registry.terraform.io/hashicorp/test",
|
|
"name": "baz",
|
|
"change": {
|
|
"actions": [
|
|
"update"
|
|
],
|
|
"before": {
|
|
"ami": "foo",
|
|
"id": "placeholder"
|
|
},
|
|
"after": {
|
|
"ami": "baz",
|
|
"id": "placeholder"
|
|
},
|
|
"after_unknown": {},
|
|
"after_sensitive": {},
|
|
"before_sensitive": {}
|
|
}
|
|
}
|
|
],
|
|
"prior_state": {
|
|
"format_version": "0.2",
|
|
"values": {
|
|
"root_module": {
|
|
"resources": [
|
|
{
|
|
"address": "test_instance.baz",
|
|
"mode": "managed",
|
|
"type": "test_instance",
|
|
"name": "baz",
|
|
"schema_version": 0,
|
|
"provider_name": "registry.terraform.io/hashicorp/test",
|
|
"values": {
|
|
"ami": "foo",
|
|
"id": "placeholder"
|
|
},
|
|
"sensitive_values": {}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"configuration": {
|
|
"root_module": {
|
|
"resources": [
|
|
{
|
|
"address": "test_instance.baz",
|
|
"mode": "managed",
|
|
"type": "test_instance",
|
|
"name": "baz",
|
|
"provider_config_key": "test",
|
|
"schema_version": 0,
|
|
"expressions": {
|
|
"ami": {
|
|
"constant_value": "baz"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|