diff --git a/cloudamqp/resource_cloudamqp_notification.go b/cloudamqp/resource_cloudamqp_notification.go index 26723258..efa9bd5f 100644 --- a/cloudamqp/resource_cloudamqp_notification.go +++ b/cloudamqp/resource_cloudamqp_notification.go @@ -28,9 +28,10 @@ func resourceNotification() *schema.Resource { Description: "Instance identifier", }, "type": { - Type: schema.TypeString, - Required: true, - Description: "Type of the notification, valid options are: email, webhook, pagerduty, victorops, opsgenie, opsgenie-eu, slack, teams", + Type: schema.TypeString, + Required: true, + Description: "Type of the notification, valid options are: email, opsgenie, opsgenie-eu," + + "pagerduty, slack, signl4, teams, victorops, webhook", ValidateFunc: validateNotificationType(), }, "value": { @@ -134,13 +135,14 @@ func resourceNotificationDelete(d *schema.ResourceData, meta interface{}) error func validateNotificationType() schema.SchemaValidateFunc { return validation.StringInSlice([]string{ "email", - "webhook", - "pagerduty", - "victorops", "opsgenie", "opsgenie-eu", + "pagerduty", + "signl4", "slack", "teams", + "victorops", + "webhook", }, true) } diff --git a/docs/resources/notification.md b/docs/resources/notification.md index 2a642939..e4fb3fe1 100644 --- a/docs/resources/notification.md +++ b/docs/resources/notification.md @@ -13,25 +13,44 @@ Available for all subscription plans. ## Example Usage +
+ + Email recipient + + ```hcl -# New recipient to receieve notifications resource "cloudamqp_notification" "email_recipient" { instance_id = cloudamqp_instance.instance.id type = "email" value = "alarm@example.com" name = "alarm" } +``` -resource "cloudamqp_notification" "victorops_recipient" { +
+ +
+ + OpsGenie recipient + + +```hcl +resource "cloudamqp_notification" "opsgenie_recipient" { instance_id = cloudamqp_instance.instance.id - type = "victorops" - value = "" - name = "Victorops" - options = { - "rk" = "ROUTINGKEY" - } + type = "opsgenie" # or "opsgenie-eu" + value = "" + name = "OpsGenie" } +``` +
+ +
+ + Pagerduty recipient + + +```hcl resource "cloudamqp_notification" "pagerduty_recipient" { instance_id = cloudamqp_instance.instance.id type = "pagerduty" @@ -43,6 +62,75 @@ resource "cloudamqp_notification" "pagerduty_recipient" { } ``` +
+ +
+ + Signl4 recipient + + +```hcl +resource "cloudamqp_notification" "signl4_recipient" { + instance_id = cloudamqp_instance.instance.id + type = "signl4" + value = "" + name = "Signl4" +} +``` + +
+ +
+ + Teams recipient + + +```hcl +resource "cloudamqp_notification" "teams_recipient" { + instance_id = cloudamqp_instance.instance.id + type = "teams" + value = "" + name = "Teams" +} +``` + +
+ +
+ + Victorops recipient + + +```hcl +resource "cloudamqp_notification" "victorops_recipient" { + instance_id = cloudamqp_instance.instance.id + type = "victorops" + value = "" + name = "Victorops" + options = { + "rk" = "ROUTINGKEY" + } +} +``` + +
+ +
+ + Webhook recipient + + +```hcl +resource "cloudamqp_notification" "webhook_recipient" { + instance_id = cloudamqp_instance.instance.id + type = "webhook" + value = "" + name = "Webhook" +} +``` + +
+ ## Argument Reference The following arguments are supported: @@ -64,19 +152,20 @@ All attributes reference are computed Valid options for notification type. * email -* webhook -* pagerduty -* victorops * opsgenie * opsgenie-eu +* pagerduty +* signl4 * slack * teams +* victorops +* webhook ## Options parameter -| Type | Options | Description | Note | -|-----------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------| -| Victorops | rk | Routing key to route alarm notification | - | +| Type | Options | Description | Note | +|---|---|---|---| +| Victorops | rk | Routing key to route alarm notification | - | | PagerDuty | dedupkey | Default the dedup key for PagerDuty is generated depending on what alarm has triggered, but here you can set what `dedup` key to use so even if the same alarm is triggered for different resources you only get one notification. Leave blank to use the generated dedup key. | If multiple alarms are triggered using this recipient, since they all share `dedup` key only the first alarm will be shown in PagerDuty | ## Dependency