datadog: Fix incorrect schema of monitor for 'silenced' (#12720)
This commit is contained in:
parent
1df1c21d5b
commit
8730bf125f
|
@ -110,15 +110,10 @@ func resourceDatadogMonitor() *schema.Resource {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
// TODO should actually be map[string]int
|
|
||||||
"silenced": {
|
"silenced": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{
|
Elem: schema.TypeInt,
|
||||||
Type: schema.TypeString,
|
|
||||||
Elem: &schema.Schema{
|
|
||||||
Type: schema.TypeInt},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
"include_tags": {
|
"include_tags": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
|
@ -158,7 +153,7 @@ func buildMonitorStruct(d *schema.ResourceData) *datadog.Monitor {
|
||||||
s := make(map[string]int)
|
s := make(map[string]int)
|
||||||
// TODO: this is not very defensive, test if we can fail on non int input
|
// TODO: this is not very defensive, test if we can fail on non int input
|
||||||
for k, v := range attr.(map[string]interface{}) {
|
for k, v := range attr.(map[string]interface{}) {
|
||||||
s[k], _ = strconv.Atoi(v.(string))
|
s[k] = v.(int)
|
||||||
}
|
}
|
||||||
o.Silenced = s
|
o.Silenced = s
|
||||||
}
|
}
|
||||||
|
@ -364,7 +359,7 @@ func resourceDatadogMonitorUpdate(d *schema.ResourceData, meta interface{}) erro
|
||||||
// TODO: this is not very defensive, test if we can fail non int input
|
// TODO: this is not very defensive, test if we can fail non int input
|
||||||
s := make(map[string]int)
|
s := make(map[string]int)
|
||||||
for k, v := range attr.(map[string]interface{}) {
|
for k, v := range attr.(map[string]interface{}) {
|
||||||
s[k], _ = strconv.Atoi(v.(string))
|
s[k] = v.(int)
|
||||||
}
|
}
|
||||||
o.Silenced = s
|
o.Silenced = s
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue