From 5f33f028b2f5cf141426ba6e04dea194f3de182e Mon Sep 17 00:00:00 2001 From: porqueoutai Date: Fri, 21 Apr 2023 15:42:10 +0200 Subject: [PATCH] CE: no infinite calls --- internal/service/ce/cost_category.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/ce/cost_category.go b/internal/service/ce/cost_category.go index 3e788023b18..1161a3f2d3e 100644 --- a/internal/service/ce/cost_category.go +++ b/internal/service/ce/cost_category.go @@ -280,9 +280,9 @@ func schemaCostCategoryRule() *schema.Resource { } func schemaCostCategoryRuleLevel(level int) *schema.Resource { - var elem interface{} = schemaCostCategoryRuleLevel(level + 1) - if level == costCategoryRuleMaxNesting { - elem = schemaCostCategoryRuleExpression() + var elem interface{} = schemaCostCategoryRuleExpression() + if level < costCategoryRuleMaxNesting { + elem = schemaCostCategoryRuleLevel(level + 1) } return &schema.Resource{ Schema: map[string]*schema.Schema{