Closed doctornkz closed 5 years ago
Hmm. I am wrong API gives me
"notifications" : [ {
"type" : "Team",
"team" : "****"
} ],
It's List of Maps
, definitely
It's definitely a list of maps. The Terraform provider — for reasons that predate me — uses this string format. Soon, in this PR the Terraform provider will use this librfary under the hood instead of it's current map[string]interface{}
.
Thank you, friend. Right now it seems impossible to create detector with Map objects:
Error: signalfx_detector.sfx-D-*****: rule.0.notifications.2 must be a single value, not a map
I tried that section inside tf
config file :
notifications = [{ team = "****", type = "Team" }, { email = "*******@olx.com", type = "Email" }, { channel = "#alerts_critical", credentialId = "****", type = "Slack" }]
}
}
8(
Yes, that's because the string form is used in Terraform! Here are the docs for that.
You'll want something like this on the Terraform side:
rule {
…
notifications = ["Team,***", "Email,*******@olx.com"]
}
But on the client lib side, the aforementioned list of maps is the way.
No problem friends, I gonna implement wrapper around signalFX's notification object. Thank you for your help and time!
🙇
We have a different meaning of
notification
field in detector's code and from terraform-provider documentation. Documentation:Code:
So, what do we have
List of strings
orList of Maps
? List of strings more preferable, cos more easier to process it withcty
library.