@@ -45,6 +45,12 @@ func resourceSumologicCSECustomInsight() *schema.Resource {
4545 Required : true ,
4646 ValidateFunc : validation .StringInSlice ([]string {"HIGH" , "MEDIUM" , "LOW" , "CRITICAL" }, false ),
4747 },
48+ "signal_match_strategy" : {
49+ Type : schema .TypeString ,
50+ Optional : true ,
51+ Default : "ENTITY" ,
52+ ValidateFunc : validation .StringInSlice ([]string {"ENTITY" , "STRICT" }, false ),
53+ },
4854 "dynamic_severity" : {
4955 Type : schema .TypeList ,
5056 Optional : true ,
@@ -103,6 +109,7 @@ func resourceSumologicCSECustomInsightRead(d *schema.ResourceData, meta interfac
103109 d .Set ("ordered" , CSECustomInsightGet .Ordered )
104110 d .Set ("rule_ids" , CSECustomInsightGet .RuleIds )
105111 d .Set ("severity" , CSECustomInsightGet .Severity )
112+ d .Set ("signal_match_strategy" , CSECustomInsightGet .SignalMatchStrategy )
106113 d .Set ("dynamic_severity" , dynamicSeverityArrayToResource (CSECustomInsightGet .DynamicSeverity ))
107114 d .Set ("signal_names" , CSECustomInsightGet .SignalNames )
108115 d .Set ("tags" , CSECustomInsightGet .Tags )
@@ -121,15 +128,16 @@ func resourceSumologicCSECustomInsightCreate(d *schema.ResourceData, meta interf
121128
122129 if d .Id () == "" {
123130 id , err := c .CreateCSECustomInsight (CSECustomInsight {
124- Description : d .Get ("description" ).(string ),
125- Enabled : d .Get ("enabled" ).(bool ),
126- RuleIds : resourceToStringArray (d .Get ("rule_ids" ).([]interface {})),
127- Name : d .Get ("name" ).(string ),
128- Ordered : d .Get ("ordered" ).(bool ),
129- Severity : d .Get ("severity" ).(string ),
130- DynamicSeverity : resourceToDynamicSeverityArray (d .Get ("dynamic_severity" ).([]interface {})),
131- SignalNames : resourceToStringArray (d .Get ("signal_names" ).([]interface {})),
132- Tags : resourceToStringArray (d .Get ("tags" ).([]interface {})),
131+ Description : d .Get ("description" ).(string ),
132+ Enabled : d .Get ("enabled" ).(bool ),
133+ RuleIds : resourceToStringArray (d .Get ("rule_ids" ).([]interface {})),
134+ Name : d .Get ("name" ).(string ),
135+ Ordered : d .Get ("ordered" ).(bool ),
136+ Severity : d .Get ("severity" ).(string ),
137+ SignalMatchStrategy : resourceToSignalMatchStrategy (d .Get ("signal_match_strategy" )),
138+ DynamicSeverity : resourceToDynamicSeverityArray (d .Get ("dynamic_severity" ).([]interface {})),
139+ SignalNames : resourceToStringArray (d .Get ("signal_names" ).([]interface {})),
140+ Tags : resourceToStringArray (d .Get ("tags" ).([]interface {})),
133141 })
134142
135143 if err != nil {
@@ -162,16 +170,17 @@ func resourceToCSECustomInsight(d *schema.ResourceData) (CSECustomInsight, error
162170 }
163171
164172 return CSECustomInsight {
165- ID : id ,
166- Description : d .Get ("description" ).(string ),
167- Enabled : d .Get ("enabled" ).(bool ),
168- RuleIds : resourceToStringArray (d .Get ("rule_ids" ).([]interface {})),
169- Name : d .Get ("name" ).(string ),
170- Ordered : d .Get ("ordered" ).(bool ),
171- Severity : d .Get ("severity" ).(string ),
172- DynamicSeverity : resourceToDynamicSeverityArray (d .Get ("dynamic_severity" ).([]interface {})),
173- SignalNames : resourceToStringArray (d .Get ("signal_names" ).([]interface {})),
174- Tags : resourceToStringArray (d .Get ("tags" ).([]interface {})),
173+ ID : id ,
174+ Description : d .Get ("description" ).(string ),
175+ Enabled : d .Get ("enabled" ).(bool ),
176+ RuleIds : resourceToStringArray (d .Get ("rule_ids" ).([]interface {})),
177+ Name : d .Get ("name" ).(string ),
178+ Ordered : d .Get ("ordered" ).(bool ),
179+ Severity : d .Get ("severity" ).(string ),
180+ SignalMatchStrategy : resourceToSignalMatchStrategy (d .Get ("signal_match_strategy" )),
181+ DynamicSeverity : resourceToDynamicSeverityArray (d .Get ("dynamic_severity" ).([]interface {})),
182+ SignalNames : resourceToStringArray (d .Get ("signal_names" ).([]interface {})),
183+ Tags : resourceToStringArray (d .Get ("tags" ).([]interface {})),
175184 }, nil
176185}
177186
@@ -200,3 +209,10 @@ func dynamicSeverityArrayToResource(dynamicSeverities []DynamicSeverity) []map[s
200209
201210 return result
202211}
212+
213+ func resourceToSignalMatchStrategy (value any ) string {
214+ if v , ok := value .(string ); ok {
215+ return v
216+ }
217+ return ""
218+ }
0 commit comments