寻找一个好的示例或输入列表,以提供Terraform脚本来创建New Relic Slack Alert Channel。我发现的唯一例子是Terraform文档,但是用于电子邮件。
在这里猜测,但Slack可能有所不同
# Add a notification channel
resource "newrelic_alert_channel" "email" {
name = "email"
type = "email"
configuration = {
recipients = "[email protected]"
include_json_attachment = "1"
}
}
资源newrelic_alert_channel确实支持slack
类型。
type - (必需)通道的类型。其中之一:篝火,电子邮件,hipchat,opsgenie,pagerduty,slack,victorops或webhook。
"slack": {
"channel",
"url",
},
我没有测试,但这段代码会起作用吗?
resource "newrelic_alert_channel" "slack" {
name = "alerts"
type = "slack"
configuration = {
channel = "alerts"
url = "https://hooks.slack.com/services/***********"
}
}