@@ -866,7 +866,9 @@ func (n *NodeAbstractResourceInstance) plan(
866866 diags = diags .Append (
867867 validateResourceForbiddenEphemeralValues (ctx , origConfigVal , schema .Body ).InConfigBody (n .Config .Config , n .Addr .String ()),
868868 )
869- diags = diags .Append (ctx .Deprecations ().ValidateAsConfig (origConfigVal , schema .Body , n .ModulePath ()).InConfigBody (n .Config .Config , n .Addr .String ()))
869+ var deprecationDiags tfdiags.Diagnostics
870+ origConfigVal , deprecationDiags = ctx .Deprecations ().ValidateAsConfig (origConfigVal , schema .Body , n .ModulePath ())
871+ diags = diags .Append (deprecationDiags .InConfigBody (n .Config .Config , n .Addr .String ()))
870872 if diags .HasErrors () {
871873 return nil , nil , deferred , keyData , diags
872874 }
@@ -1772,10 +1774,9 @@ func (n *NodeAbstractResourceInstance) providerMetas(ctx EvalContext) (cty.Value
17721774 var configDiags tfdiags.Diagnostics
17731775 metaConfigVal , _ , configDiags = ctx .EvaluateBlock (m .Config , providerSchema .ProviderMeta .Body , nil , EvalDataForNoInstanceKey )
17741776 diags = diags .Append (configDiags )
1775- diags = diags .Append (
1776- ctx .Deprecations ().ValidateAsConfig (metaConfigVal , providerSchema .ProviderMeta .Body , ctx .Path ().Module ()).InConfigBody (m .Config , n .Addr .String ()),
1777- )
1778- metaConfigVal = marks .RemoveDeprecationMarks (metaConfigVal )
1777+ var deprecationDiags tfdiags.Diagnostics
1778+ metaConfigVal , deprecationDiags = ctx .Deprecations ().ValidateAsConfig (metaConfigVal , providerSchema .ProviderMeta .Body , ctx .Path ().Module ())
1779+ diags = diags .Append (deprecationDiags .InConfigBody (m .Config , n .Addr .String ()))
17791780 }
17801781 }
17811782 }
@@ -1852,10 +1853,11 @@ func (n *NodeAbstractResourceInstance) planDataSource(ctx EvalContext, checkRule
18521853 diags = diags .Append (
18531854 validateResourceForbiddenEphemeralValues (ctx , configVal , schema .Body ).InConfigBody (n .Config .Config , n .Addr .String ()),
18541855 )
1855- diags = diags .Append (
1856- ctx .Deprecations ().ValidateAsConfig (configVal , schema .Body , ctx .Path ().Module ()).InConfigBody (n .Config .Config , n .Addr .String ()),
1857- )
1858- configVal = marks .RemoveDeprecationMarks (configVal )
1856+
1857+ var deprecationDiags tfdiags.Diagnostics
1858+ configVal , deprecationDiags = ctx .Deprecations ().ValidateAsConfig (configVal , schema .Body , ctx .Path ().Module ())
1859+ diags = diags .Append (deprecationDiags .InConfigBody (n .Config .Config , n .Addr .String ()))
1860+
18591861 if diags .HasErrors () {
18601862 return nil , nil , deferred , keyData , diags
18611863 }
@@ -2193,13 +2195,13 @@ func (n *NodeAbstractResourceInstance) applyDataSource(ctx EvalContext, planned
21932195 return nil , keyData , diags
21942196 }
21952197
2196- diags = diags .Append (
2197- ctx .Deprecations ().ValidateAsConfig (configVal , schema .Body , n .ModulePath ()).InConfigBody (n .Config .Config , n .Addr .String ()),
2198- )
2198+ var deprecationDiags tfdiags.Diagnostics
2199+ configVal , deprecationDiags = ctx .Deprecations ().ValidateAsConfig (configVal , schema .Body , n .ModulePath ())
2200+ diags = diags .Append (deprecationDiags .InConfigBody (n .Config .Config , n .Addr .String ()))
2201+
21992202 if diags .HasErrors () {
22002203 return nil , keyData , diags
22012204 }
2202- configVal = marks .RemoveDeprecationMarks (configVal )
22032205
22042206 newVal , readDeferred , readDiags := n .readDataSource (ctx , configVal )
22052207 if check , nested := n .nestedInCheckBlock (); nested {
@@ -2512,8 +2514,9 @@ func (n *NodeAbstractResourceInstance) evalProvisionerConfig(ctx EvalContext, bo
25122514
25132515 config , _ , configDiags := ctx .EvaluateBlock (body , schema , n .ResourceInstanceAddr ().Resource , keyData )
25142516 diags = diags .Append (configDiags )
2515- diags = diags .Append (ctx .Deprecations ().ValidateAsConfig (config , schema , n .ModulePath ()).InConfigBody (body , n .Addr .String ()))
2516- config = marks .RemoveDeprecationMarks (config )
2517+ var deprecationDiags tfdiags.Diagnostics
2518+ config , deprecationDiags = ctx .Deprecations ().ValidateAsConfig (config , schema , n .ModulePath ())
2519+ diags = diags .Append (deprecationDiags .InConfigBody (body , n .Addr .String ()))
25172520
25182521 return config , diags
25192522}
@@ -2531,8 +2534,9 @@ func (n *NodeAbstractResourceInstance) evalDestroyProvisionerConfig(ctx EvalCont
25312534 evalScope := ctx .EvaluationScope (n .ResourceInstanceAddr ().Resource , nil , keyData )
25322535 config , evalDiags := evalScope .EvalSelfBlock (body , self , schema , keyData )
25332536 diags = diags .Append (evalDiags )
2534- diags = diags .Append (ctx .Deprecations ().ValidateAsConfig (config , schema , n .ModulePath ()).InConfigBody (body , n .Addr .String ()))
2535- config = marks .RemoveDeprecationMarks (config )
2537+ var deprecationDiags tfdiags.Diagnostics
2538+ config , deprecationDiags = ctx .Deprecations ().ValidateAsConfig (config , schema , n .ModulePath ())
2539+ diags = diags .Append (deprecationDiags .InConfigBody (body , n .Addr .String ()))
25362540 return config , diags
25372541}
25382542
0 commit comments