File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ resource "test_object" "test" {
179179}
180180` ,
181181 },
182- expectPlanDiagnostics : func (m * configs.Config ) (diags tfdiags.Diagnostics ) {
182+ expectValidateDiagnostics : func (m * configs.Config ) (diags tfdiags.Diagnostics ) {
183183 return diags .Append (& hcl.Diagnostic {
184184 Severity : hcl .DiagError ,
185185 Summary : "Invalid count argument" ,
Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ func (n *NodeValidatableResource) validateResource(ctx EvalContext) tfdiags.Diag
300300
301301 // Basic type-checking of the count argument. More complete validation
302302 // of this will happen when we DynamicExpand during the plan walk.
303- countDiags := validateCount ( ctx , n .Config .Count )
303+ _ , countDiags := evaluateCountExpressionValue ( n .Config .Count , ctx )
304304 diags = diags .Append (countDiags )
305305
306306 case n .Config .ForEach != nil :
@@ -727,21 +727,6 @@ func (n *NodeValidatableResource) validateConfigGen(ctx EvalContext) tfdiags.Dia
727727 return diags
728728}
729729
730- func validateCount (ctx EvalContext , expr hcl.Expression ) (diags tfdiags.Diagnostics ) {
731- val , countDiags := evaluateCountExpressionValue (expr , ctx )
732- // If the value isn't known then that's the best we can do for now, but
733- // we'll check more thoroughly during the plan walk
734- if ! val .IsKnown () {
735- return diags
736- }
737-
738- if countDiags .HasErrors () {
739- diags = diags .Append (countDiags )
740- }
741-
742- return diags
743- }
744-
745730func validateDependsOn (ctx EvalContext , dependsOn []hcl.Traversal ) (diags tfdiags.Diagnostics ) {
746731 for _ , traversal := range dependsOn {
747732 ref , refDiags := addrs .ParseRef (traversal )
You can’t perform that action at this time.
0 commit comments