This commit is contained in:
devhindo 2026-05-24 10:40:09 +03:00 committed by GitHub
commit 36f85fed19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View file

@ -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

View file

@ -985,7 +985,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},
@ -1020,7 +1020,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},

View file

@ -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