Skip to content

Commit 5dc283d

Browse files
authored
Merge pull request #410 from SumoLogic/aggr-check
SUMO-189150: removing validations from tf for SLI window aggregation
2 parents bc6b313 + f540b27 commit 5dc283d

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

sumologic/resource_sumologic_slo.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,14 @@ import (
55
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
66
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
77
"log"
8-
"regexp"
98
)
109

11-
const sloAggregationRegexString = `^(Avg|Min|Max|Sum|(p[5-9][0-9])(\.\d{1,3})?$)$` // TODO update it to allow lower pct values
12-
const sloAggregationWindowRegexString = `^[0-9]{1,2}(m|h)$` // TODO make it exact of min 1m and max 1h
1310
const fieldNameWindowBasedEvaluation = `window_based_evaluation`
1411
const fieldNameRequestBasedEvaluation = `request_based_evaluation`
1512
const sloContentTypeString = "Slo"
1613

1714
func resourceSumologicSLO() *schema.Resource {
1815

19-
aggrRegex := regexp.MustCompile(sloAggregationRegexString)
20-
windowRegex := regexp.MustCompile(sloAggregationWindowRegexString)
21-
2216
queryGroupElemSchema := &schema.Resource{
2317
Schema: map[string]*schema.Schema{
2418
"row_id": {
@@ -111,14 +105,12 @@ func resourceSumologicSLO() *schema.Resource {
111105
}, false),
112106
},
113107
"aggregation": {
114-
Type: schema.TypeString,
115-
Optional: true,
116-
ValidateFunc: validation.StringMatch(aggrRegex, `value must match : `+sloAggregationRegexString),
108+
Type: schema.TypeString,
109+
Optional: true,
117110
},
118111
"size": {
119112
Type: schema.TypeString,
120113
Required: true,
121-
ValidateFunc: validation.StringMatch(windowRegex, `value must match : `+sloAggregationWindowRegexString),
122114
},
123115
},
124116
}

0 commit comments

Comments
 (0)