diff --git a/terraform/context_test.go b/terraform/context_test.go index ea901e4872..79e70c8e59 100644 --- a/terraform/context_test.go +++ b/terraform/context_test.go @@ -613,12 +613,11 @@ func TestContext2Plan_countIndexZero(t *testing.T) { } } -/* -func TestContextPlan_countVar(t *testing.T) { +func TestContext2Plan_countVar(t *testing.T) { m := testModule(t, "plan-count-var") p := testProvider("aws") p.DiffFn = testDiffFn - ctx := testContext(t, &ContextOpts{ + ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), @@ -640,6 +639,7 @@ func TestContextPlan_countVar(t *testing.T) { } } +/* func TestContextPlan_countZero(t *testing.T) { m := testModule(t, "plan-count-zero") p := testProvider("aws") diff --git a/terraform/graph_config_node.go b/terraform/graph_config_node.go index e7fb29a55f..74756ff4da 100644 --- a/terraform/graph_config_node.go +++ b/terraform/graph_config_node.go @@ -217,9 +217,14 @@ func (n *GraphNodeConfigResource) DynamicExpand(ctx EvalContext) (*Graph, error) // GraphNodeEvalable impl. func (n *GraphNodeConfigResource) EvalTree() EvalNode { - return &EvalOpFilter{ - Ops: []walkOperation{walkValidate}, - Node: &EvalValidateCount{Resource: n.Resource}, + return &EvalSequence{ + Nodes: []EvalNode{ + &EvalInterpolate{Config: n.Resource.RawCount}, + &EvalOpFilter{ + Ops: []walkOperation{walkValidate}, + Node: &EvalValidateCount{Resource: n.Resource}, + }, + }, } }