terraform/internal/tfdiags
Alisdair McDiarmid a103c65140 core: Eval pre/postconditions in refresh-only mode
Evaluate precondition and postcondition blocks in refresh-only mode, but
report any failures as warnings instead of errors. This ensures that any
deviation from the contract defined by condition blocks is reported as
early as possible, without preventing the completion of a state refresh
operation.

Prior to this commit, Terraform evaluated output preconditions and data
source pre/postconditions as normal in refresh-only mode, while managed
resource pre/postconditions were not evaluated at all. This omission
could lead to confusing partial condition errors, or failure to detect
undesired changes which would otherwise cause resources to become
invalid.

Reporting the failures as errors also meant that changes retrieved
during refresh could cause the refresh operation to fail. This is also
undesirable, as the primary purpose of the operation is to update local
state. Precondition/postcondition checks are still valuable here, but
should be informative rather than blocking.
2022-03-11 13:32:40 -05:00
..
config_traversals.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
consolidate_warnings.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
consolidate_warnings_test.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
contextual.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
contextual_test.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
diagnostic.go core: Eval pre/postconditions in refresh-only mode 2022-03-11 13:32:40 -05:00
diagnostic_base.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
diagnostics.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
diagnostics_test.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
doc.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
error.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
hcl.go core: Eval pre/postconditions in refresh-only mode 2022-03-11 13:32:40 -05:00
hcl_test.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
rpc_friendly.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
rpc_friendly_test.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
severity_string.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
simple_warning.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
source_range.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
sourceless.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00