terraform/internal/command/testdata/show-json/conditions/output-refresh-only.json
Bruno Schaatsbergen 098234e244
states: check root output value changes in refresh-only mode (#35812)
* check root output values when determining plan applicability in refresh mode

In refresh-only mode, we do not anticipate proposing any actions; however, a plan is marked as “applyable” if there are changes in the state between runs. Currently, a plan is considered “applyable” only when there are differences in managed resources. This approach seems to overlook changes in root output values. As a result, a plan can be marked as non-applyable, even when there are changes in the root output value, due to the lack of detected changes since only managed resources were checked.

* set 'applyable' to true
2024-10-23 15:27:53 +02:00

217 lines
4.7 KiB
JSON

{
"format_version": "1.2",
"terraform_version": "1.8.0-dev",
"applyable": true,
"complete": true,
"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.8.0",
"values": {
"outputs": {
"foo_id": {
"sensitive": false,
"value": "placeholder",
"type": "string"
}
},
"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": {
"password": true
}
},
{
"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": {
"password": true
}
}
]
}
}
},
"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"
]
}
],
"checks": [
{
"address": {
"kind": "output_value",
"name": "foo_id",
"to_display": "output.foo_id"
},
"status": "pass",
"instances": [
{
"address": {
"to_display": "output.foo_id"
},
"status": "pass"
}
]
},
{
"address": {
"kind": "resource",
"mode": "managed",
"name": "bar",
"to_display": "test_instance.bar",
"type": "test_instance"
},
"status": "fail",
"instances": [
{
"address": {
"to_display": "test_instance.bar"
},
"status": "fail",
"problems": [
{
"message": "Resource ID is unacceptably short (9 characters)."
}
]
}
]
},
{
"address": {
"kind": "resource",
"mode": "managed",
"name": "foo",
"to_display": "test_instance.foo",
"type": "test_instance"
},
"status": "fail",
"instances": [
{
"address": {
"to_display": "test_instance.foo"
},
"status": "fail",
"problems": [
{
"message": "Invalid AMI ID: must start with \"ami-\"."
}
]
}
]
}
],
"timestamp": "2024-01-24T18:33:05Z",
"errored": false
}