chaossearch_destination Resource
The chaossearch_destination resource creates an alerting destination resource.
You can send notifications to destinations such as Slack channels or Webhook integrations. These resources are part of the Search Analytics > Alerts user interface area. After you create a destination, you can create one or more monitors to specify conditions to watch for, and which will trigger notifications to a destination when activated.
For more information about creating destinations, see Alert Destinations.
Destinations require user_name/password authentication.
When you define destination resources in your Terraform files, you must specify a username/password login pair because API key authentication is not supported for destinations. If you specify only an API key and secret combination, the chaossearch_destination resource fails and displays the error:
Error: Failed to authenticate => API Keys used with incompatible resource
Example Usage
The structure of a destination resource for a Slack channel follows:
resource "chaossearch_destination" "dest" {
name = "tf-provider-destination"
type = "slack"
slack {
url = "<http://mycompany.slack.com/archives/ABCDE12345>"
}
}
Resource restrictions
The
slack
andcustom_webhook
configurations cannot both be declared in the sameresource
block.
The structure of a destination resource for a custom Webhook defined by a URL follows:
resource "chaossearch_destination" "dest_custom" {
name = "tf-provider-destination-custom"
type = "custom_webhook"
custom_webhook {
url = "<http://test.com>"
}
}
The structure of a destination resource for a custom Webhook defined by custom attributes follows:
resource "chaossearch_destination" "dest_custom_host" {
name = "tf-provider-destination-custom-host"
type = "custom_webhook"
custom_webhook {
scheme = "HTTPS"
host = "test.com"
path = "/api/test"
port = "8080"
method = "POST"
query_params = jsonencode({
"test": "value"
})
header_params = jsonencode({
"Content-Type": "application/json"
})
}
}
Custom webhook notes
When using a
custom_webhook
defined by custom attributes, ignore theurl
value and specify the required attributes in thehost
,path
,port
,scheme
and related attribute-specific fields.
Argument Reference
Field | Required | Description | |
---|---|---|---|
| Yes | The name of the destination | |
| Yes | Specifies whether the destination is of type | |
| No | Defines a Slack channel destination | |
| No | The URL for the Slack channel | |
| No | The URL for the custom webhook | |
| No | For a custom webhook defined by URL, specify the URL of the destination. No other fields are needed. As an alternative to | |
| No | For a custom webhook defined by attributes, specify the webhook protocol as either | |
| No | For a custom webhook defined by attributes, specify the host domain. | |
| No | For a custom webhook defined by attributes, specify the target path. | |
| No | For a custom webhook defined by attributes, specify the port value. | |
| No | For a custom webhook defined by attributes, specify the REST method such as | |
| No | For a custom webhook defined by attributes, specify any required | |
| No | For a custom webhook defined by attributes, specify any required header information values inside a |
Updated 14 days ago