terraform/internal/command/jsonconfig
Kristin Laemmert 76a9aa288b
fix: move parsing action reference expressions into terraform (#37458)
* properly parse actions during configuration loading
* parse action expression during ActionPlanTransformer transform
* fix: properly parse action expressions (not traversals)

Previously, we were storing action and linkedResource expressions as Traversals during config loading. This PR replaces those fields with hcl.Expression, moves some validation around to account for the fact we don't have fully evaluated traversals yet (some checks have been removed entirely and will be replaced in a follow up PR, I wanted to get this right first), and finally moves the actual evaluation into the terraform graph build phase.

 I added a permissive parsing of the ActionExpression during ActionPlanTransformer.transformSingle (to get the config action) and store the action expression inside the nodeActionTriggerPlanExpand.lifecycleActionTrigger so it can be fully evaluated (with access to the resource's repetition data, which is necessary if the action in the resource's lifecycle block uses count.index or for_each.key) during nodeActionTriggerPlanExpand.DynamicExpand
2025-08-22 11:23:55 -04:00
..
config.go add actions to the planfile config 2025-08-06 10:38:21 +02:00
config_test.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
doc.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
expression.go fix: move parsing action reference expressions into terraform (#37458) 2025-08-22 11:23:55 -04:00
expression_test.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00