-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* CCL-1465: Adding webhook snow integration Signed-off-by: Babatunde Kassim <[email protected]> * CCL-1465: Adding webhook snow integration Signed-off-by: Babatunde Kassim <[email protected]> --------- Signed-off-by: Babatunde Kassim <[email protected]>
- Loading branch information
1 parent
0bc192b
commit 1b81224
Showing
3 changed files
with
183 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
resource "dynatrace_alerting" "cosmos-integration-alerting-profile" { | ||
name = var.alerting_profile_name | ||
rules { | ||
rule { | ||
include_mode = var.availability_include_mode | ||
delay_in_minutes = var.availability_delay_in_minutes | ||
severity_level = "AVAILABILITY" | ||
} | ||
rule { | ||
include_mode = var.custom_alert_include_mode | ||
delay_in_minutes = var.custom_alert_delay_in_minutes | ||
severity_level = "CUSTOM_ALERT" | ||
} | ||
rule { | ||
include_mode = var.errors_include_mode | ||
delay_in_minutes = var.errors_delay_in_minutes | ||
severity_level = "ERRORS" | ||
} | ||
rule { | ||
include_mode = var.monitoring_unavailable_include_mode | ||
delay_in_minutes = var.monitoring_unavailable_delay_in_minutes | ||
severity_level = "MONITORING_UNAVAILABLE" | ||
} | ||
rule { | ||
include_mode = var.performance_include_mode | ||
delay_in_minutes = var.performance_delay_in_minutes | ||
severity_level = "PERFORMANCE" | ||
} | ||
rule { | ||
include_mode = var.resource_contention_include_mode | ||
delay_in_minutes = var.resource_contention_delay_in_minutes | ||
severity_level = "RESOURCE_CONTENTION" | ||
} | ||
} | ||
} | ||
|
||
resource "dynatrace_webhook_notification" "snow_webhook_integration" { | ||
active = var.active | ||
name = var.integration_notification_name | ||
profile = dynatrace_alerting.cosmos-snow-alerting-profile.id | ||
url = var.webhook_url | ||
insecure = var.insecure | ||
notify_event_merges = var.notify_closed_problems | ||
notify_closed_problems = var.notify_closed_problems | ||
payload = var.payload | ||
use_oauth_2 = var.use_oauth_2 | ||
oauth_2_credentials { | ||
access_token_url = var.access_token_url | ||
client_id = var.client_id | ||
client_secret = var.client_secret | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
terraform { | ||
required_providers { | ||
dynatrace = { | ||
version = "~> 1.0" | ||
source = "dynatrace-oss/dynatrace" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
variable "alerting_profile_name" { | ||
type = string | ||
description = "The name of the alerting profile." | ||
} | ||
|
||
variable "availability_include_mode" { | ||
type = string | ||
description = "The inclusion mode for availability rule." | ||
} | ||
|
||
variable "availability_delay_in_minutes" { | ||
type = string | ||
description = "The delay in minutes for availability rule." | ||
} | ||
|
||
variable "custom_alert_include_mode" { | ||
type = string | ||
description = "The inclusion mode for custom alert rule." | ||
} | ||
|
||
variable "custom_alert_delay_in_minutes" { | ||
type = string | ||
description = "The delay in minutes for custom alert rule." | ||
} | ||
|
||
variable "errors_include_mode" { | ||
type = string | ||
description = "The inclusion mode for error alert rule." | ||
} | ||
|
||
variable "errors_delay_in_minutes" { | ||
type = string | ||
description = "The delay in minutes for error alert rule." | ||
} | ||
|
||
variable "monitoring_unavailable_include_mode" { | ||
type = string | ||
description = "The inclusion mode for monitoring unavailable alert rule." | ||
} | ||
|
||
variable "monitoring_unavailable_delay_in_minutes" { | ||
type = string | ||
description = "The delay in minutes for monitoring unavailable alert rule." | ||
} | ||
|
||
variable "performance_include_mode" { | ||
type = string | ||
description = "The inclusion mode for performance alert rule." | ||
} | ||
|
||
variable "performance_delay_in_minutes" { | ||
type = string | ||
description = "The delay in minutes for performance alert rule." | ||
} | ||
|
||
variable "resource_contention_include_mode" { | ||
type = string | ||
description = "The inclusion mode for resource contention alert rule." | ||
} | ||
|
||
variable "resource_contention_delay_in_minutes" { | ||
type = string | ||
description = "The delay in minutes for resource contention alert rule." | ||
} | ||
|
||
variable "active" { | ||
type = bool | ||
description = "The configuration is enabled" | ||
} | ||
|
||
variable "integration_notification_name" { | ||
type = string | ||
description = "The name of the notification configuration" | ||
} | ||
|
||
variable "webhook_url" { | ||
type = string | ||
description = "The URL of the WebHook endpoint" | ||
} | ||
|
||
variable "insecure" { | ||
type = bool | ||
default = false | ||
description = "Accept any, including self-signed and invalid, SSL certificate" | ||
} | ||
|
||
variable "notify_event_merges" { | ||
type = bool | ||
default = false | ||
description = "Call webhook if new events merge into existing problems" | ||
} | ||
|
||
variable "notify_closed_problems" { | ||
type = bool | ||
default = false | ||
description = "Send email if problem is closed" | ||
} | ||
|
||
variable "use_oauth_2" { | ||
type = bool | ||
default = false | ||
description = "Use OAuth 2.0 for authentication" | ||
} | ||
|
||
variable "access_token_url" { | ||
type = string | ||
description = "Access token URL" | ||
} | ||
|
||
variable "client_id" { | ||
type = string | ||
description = "Client ID" | ||
} | ||
|
||
variable "client_secret" { | ||
type = string | ||
description = "Client secret" | ||
} | ||
|
||
variable "payload" { | ||
type = string | ||
description = "The content of the notification message" | ||
} |