File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff 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
1310const fieldNameWindowBasedEvaluation = `window_based_evaluation`
1411const fieldNameRequestBasedEvaluation = `request_based_evaluation`
1512const sloContentTypeString = "Slo"
1613
1714func 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 }
You can’t perform that action at this time.
0 commit comments