Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changes/v1.15/ENHANCEMENTS-20251123-224500.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: ENHANCEMENTS
body: 'core: Improved error message when an action trigger references an action expanded with count or for_each without specifying an instance'
time: 2025-11-23T22:45:00.000000+00:00
4 changes: 2 additions & 2 deletions internal/terraform/context_plan_actions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ resource "test_object" "a" {
return diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Reference to non-existent action instance",
Detail: "Action instance was not found in the current context.",
Detail: "The referenced action could not be found. If the action uses 'count' or 'for_each', ensure you reference a specific instance, such as action.example[0] or action.example[\"key\"].",
Subject: &hcl.Range{
Filename: filepath.Join(m.Module.SourceDir, "main.tf"),
Start: hcl.Pos{Line: 13, Column: 18, Byte: 224},
Expand Down Expand Up @@ -1002,7 +1002,7 @@ resource "test_object" "a" {
return diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Reference to non-existent action instance",
Detail: "Action instance was not found in the current context.",
Detail: "The referenced action could not be found. If the action uses 'count' or 'for_each', ensure you reference a specific instance, such as action.example[0] or action.example[\"key\"].",
Subject: &hcl.Range{
Filename: filepath.Join(m.Module.SourceDir, "main.tf"),
Start: hcl.Pos{Line: 13, Column: 18, Byte: 208},
Expand Down
2 changes: 1 addition & 1 deletion internal/terraform/node_action_trigger_instance_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (n *nodeActionTriggerPlanInstance) Execute(ctx EvalContext, operation walkO
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Reference to non-existent action instance",
Detail: "Action instance was not found in the current context.",
Detail: "The referenced action could not be found. If the action uses 'count' or 'for_each', ensure you reference a specific instance, such as action.example[0] or action.example[\"key\"].",
Subject: n.lifecycleActionTrigger.invokingSubject,
})
return diags
Expand Down