Skip to content

Commit

Permalink
fix: PC-9592 Validate opsgenie,slack URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrkwarcinski committed Jan 16, 2025
1 parent 107ea31 commit 253063d
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/resources/alert_method_slack.md
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ resource "nobl9_alert_method_slack" "this" {
display_name = "My Slack Alert"
project = "Test Project"
description = "slack"
url = "https://slack.com"
url = "https://hooks.slack.com/services/321/123/secret"
}
```

4 changes: 2 additions & 2 deletions examples/resources/nobl9_alert_method_slack/resource.tf
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ resource "nobl9_alert_method_slack" "this" {
name = "my-slack-alert"
display_name = "My Slack Alert"
project = "Test Project"
description = "slack"
url = "https://slack.com"
description = "slack"
url = "https://hooks.slack.com/services/321/123/secret"
}

12 changes: 6 additions & 6 deletions nobl9/resource_alert_policy_test.go
Original file line number Diff line number Diff line change
@@ -94,19 +94,19 @@ func TestAcc_Nobl9AlertPolicy(t *testing.T) {
name = "%s"
project = "%s"
description = "slack"
url = "https://slack.com"
url = "https://hooks.slack.com/services/321/123/secret"
}
resource "nobl9_alert_method_slack" "%s" {
name = "%s"
project = "%s"
description = "slack"
url = "https://slack.com"
url = "https://hooks.slack.com/services/321/123/secret"
}
resource "nobl9_alert_method_slack" "%s" {
name = "%s"
project = "%s"
description = "slack"
url = "https://slack.com"
url = "https://hooks.slack.com/services/321/123/secret"
}
`,
"am1", "am1", testProject,
@@ -134,19 +134,19 @@ func TestAcc_Nobl9AlertPolicy(t *testing.T) {
name = "%s"
project = "%s"
description = "slack"
url = "https://slack.com"
url = "https://hooks.slack.com/services/321/123/secret"
}
resource "nobl9_alert_method_slack" "%s" {
name = "%s"
project = "%s"
description = "slack"
url = "https://slack.com"
url = "https://hooks.slack.com/services/321/123/secret"
}
resource "nobl9_alert_method_slack" "%s" {
name = "%s"
project = "%s"
description = "slack"
url = "https://slack.com"
url = "https://hooks.slack.com/services/321/123/secret"
}
`,
"am1", "am1", testProject,
6 changes: 3 additions & 3 deletions nobl9/resource_alertmethod_test.go
Original file line number Diff line number Diff line change
@@ -137,7 +137,7 @@ resource "nobl9_alert_method_slack" "%s" {
name = "%s"
project = "%s"
description = "slack"
url = "https://slack.com"
url = "https://hooks.slack.com/services/321/123/secret"
}
`, name, name, testProject)
}
@@ -159,7 +159,7 @@ resource "nobl9_alert_method_opsgenie" "%s" {
name = "%s"
project = "%s"
description = "opsgenie"
url = "https://discord.com"
url = "https://api.opsgenie.com"
auth = "GenieKey 12345"
}
`, name, name, testProject)
@@ -222,7 +222,7 @@ resource "nobl9_alert_method_slack" "%s" {
name = "%s"
project = "%s"
description = "slack"
url = "https://slack.com"
url = "https://hooks.slack.com/services/321/123/secret"
}
`, name, name, project)
}

0 comments on commit 253063d

Please sign in to comment.