terraform/states
Martin Atkins 1ae47ae314 states/statefile: tolerate and ignore invalid depends_on in version 3
The state refactoring command "terraform state mv" in Terraform 0.11 does
not update existing dependency addresses recorded in the state when it
moves objects around, and Terraform only updates the dependency addresses
in the state when it performs a full update on a resource instance, and
so it's a common problem for folks updating from Terraform 0.11 with
resource names that are not valid identifiers to run into state upgrade
errors even though they have followed the instructions produced by
"terraform 0.12checklist".

Dependencies are synced from config during every refresh walk anyway, so
in practice we can get away with just discarding invalid dependency
addresses and letting the refresh walk update them. In practice these
addresses are unlikely to be pointing at a resource that actually exists
anyway, because if so Terraform 0.12's configuration parser wouldn't be
able to interpret it.

Discarding invalid dependency addresses allows the state upgrade to
complete successfully in such cases and thus gives the refresh step an
opportunity to repair the problem.
2019-11-21 09:18:49 -08:00
..
statefile states/statefile: tolerate and ignore invalid depends_on in version 3 2019-11-21 09:18:49 -08:00
statemgr states/statemgr: Properly return error when Unlock detects invalid lock id 2019-11-11 15:24:53 -08:00
doc.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
eachmode_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00
instance_generation.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
instance_object.go change state dependencies to AbsResource addrs 2019-10-30 17:25:53 -04:00
instance_object_src.go read+write the new dependencies in the statefile 2019-11-07 17:49:03 -05:00
module.go command: Un-stub and reimplement "terraform state rm" 2018-10-16 19:14:11 -07:00
objectstatus_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00
output_value.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
resource.go Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
resource_test.go states: Fix TestResourceInstanceDeposeCurrentObject 2018-10-16 19:14:11 -07:00
state.go command: Allow tests to run to completion without panics or hangs 2018-10-16 19:14:11 -07:00
state_deepcopy.go read+write the new dependencies in the statefile 2019-11-07 17:49:03 -05:00
state_equal.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
state_string.go move hcl2shim package to configs 2019-08-06 19:58:58 -04:00
state_test.go change state dependencies to AbsResource addrs 2019-10-30 17:25:53 -04:00
sync.go Reordering, comment update 2019-08-13 17:22:14 -04:00