documentation: Clarify JSON diagnostic traversal

The traversal value is normally a valid HCL string, but can be
simplified if a traversal step has a complex index value (e.g. an
object). This means it is not always parseable HCL, so this commit
updates the documentation to clarify this and explicitly record that we
do not guarantee its contents are stable. The purpose of these values is
purely for building human-readable UI.
This commit is contained in:
Alisdair McDiarmid 2021-03-17 11:43:41 -04:00
parent 53739f0aac
commit b6ca782993
1 changed files with 5 additions and 1 deletions

View File

@ -202,7 +202,11 @@ part of the expression which triggered the diagnostic. This is especially
useful when using `for_each` or similar constructs, in order to identify
exactly which values are responsible for an error. The object has two properties:
* `traversal` (string): An HCL traversal string, such as `var.instance_count`.
* `traversal` (string): An HCL-like traversal string, such as
`var.instance_count`. Complex index key values may be elided, so this will
not always be valid, parseable HCL. The contents of this string are intended
to be human-readable and are subject to change in future versions of
Terraform.
* `statement` (string): A short English-language fragment describing the value
of the expression when the diagnostic was triggered. The contents of this