diff --git a/internal/lang/eval.go b/internal/lang/eval.go index c3da4cc6c6..706a552a6b 100644 --- a/internal/lang/eval.go +++ b/internal/lang/eval.go @@ -312,7 +312,7 @@ func (s *Scope) evalContext(refs []*addrs.Reference, selfAddr addrs.Referenceabl // this codepath doesn't really "know about". If the "self" // object starts being supported in more contexts later then // we'll need to adjust this message. - Detail: `The "self" object is not available in this context. This object can be used only in resource provisioner, connection and postcondition blocks.`, + Detail: `The "self" object is not available in this context. This object can be used only in resource provisioner, connection, and postcondition blocks.`, Subject: ref.SourceRange.ToHCL().Ptr(), }) continue diff --git a/internal/terraform/context_plan2_test.go b/internal/terraform/context_plan2_test.go index 85e9d0a8f8..5d20742144 100644 --- a/internal/terraform/context_plan2_test.go +++ b/internal/terraform/context_plan2_test.go @@ -4195,7 +4195,7 @@ func TestContext2Plan_preconditionErrors(t *testing.T) { { "self.value", `Invalid "self" reference`, - "only in resource provisioner, connection and postcondition blocks", + "only in resource provisioner, connection, and postcondition blocks", }, { "data.foo.bar", diff --git a/internal/terraform/evaluate_valid.go b/internal/terraform/evaluate_valid.go index 6c7eb2cb66..16315abd5d 100644 --- a/internal/terraform/evaluate_valid.go +++ b/internal/terraform/evaluate_valid.go @@ -64,7 +64,7 @@ func (e *Evaluator) staticValidateReference(ref *addrs.Reference, modCfg *config // this codepath doesn't really "know about". If the "self" // object starts being supported in more contexts later then // we'll need to adjust this message. - Detail: `The "self" object is not available in this context. This object can be used only in resource provisioner, connection and postcondition blocks.`, + Detail: `The "self" object is not available in this context. This object can be used only in resource provisioner, connection, and postcondition blocks.`, Subject: ref.SourceRange.ToHCL().Ptr(), }) return diags