From a95ad997e1c7bc49f54bccfaf3007cfbb4c6d1bb Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Mon, 31 Jan 2022 14:32:27 -0500 Subject: [PATCH] core: Document postconditions as valid use of self This is not currently gated by the experiment only because it is awkward to do so in the context of evaluationStateData, which doesn't have any concept of experiments at the moment. --- internal/lang/eval.go | 2 +- internal/terraform/evaluate_valid.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/lang/eval.go b/internal/lang/eval.go index c1faca9e6..fe5fc1b76 100644 --- a/internal/lang/eval.go +++ b/internal/lang/eval.go @@ -296,7 +296,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 and connection 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/evaluate_valid.go b/internal/terraform/evaluate_valid.go index 232f6913d..1d43cc4fc 100644 --- a/internal/terraform/evaluate_valid.go +++ b/internal/terraform/evaluate_valid.go @@ -58,7 +58,7 @@ func (d *evaluationStateData) staticValidateReference(ref *addrs.Reference, self // 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 and connection 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