-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #880 from cjgajard/fix/endpoint_url
Allow resource extension's endpoint_url to be imported as null
- Loading branch information
Showing
3 changed files
with
119 additions
and
6 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
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
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 |
---|---|---|
|
@@ -189,3 +189,65 @@ EOF | |
`, name, extension_name, url, restrict, notify_types) | ||
} | ||
|
||
func testAccCheckPagerDutyExtensionConfig_NoEndpointURL(name, extension_name, notify_types, restrict string) string { | ||
return fmt.Sprintf(` | ||
resource "pagerduty_user" "foo" { | ||
name = "%[1]v" | ||
email = "%[1][email protected]" | ||
color = "green" | ||
role = "user" | ||
job_title = "foo" | ||
description = "foo" | ||
} | ||
resource "pagerduty_escalation_policy" "foo" { | ||
name = "%[1]v" | ||
description = "bar" | ||
num_loops = 2 | ||
rule { | ||
escalation_delay_in_minutes = 10 | ||
target { | ||
type = "user_reference" | ||
id = pagerduty_user.foo.id | ||
} | ||
} | ||
} | ||
resource "pagerduty_service" "foo" { | ||
name = "%[1]v" | ||
description = "foo" | ||
auto_resolve_timeout = 1800 | ||
acknowledgement_timeout = 1800 | ||
escalation_policy = pagerduty_escalation_policy.foo.id | ||
incident_urgency_rule { | ||
type = "constant" | ||
urgency = "high" | ||
} | ||
} | ||
data "pagerduty_extension_schema" "foo" { | ||
name = "Generic V2 Webhook" | ||
} | ||
resource "pagerduty_extension" "foo"{ | ||
name = "%s" | ||
endpoint_url = null # sensitive | ||
extension_schema = data.pagerduty_extension_schema.foo.id | ||
extension_objects = [pagerduty_service.foo.id] | ||
config = <<EOF | ||
{ | ||
"restrict": "%v", | ||
"notify_types": { | ||
"resolve": %[4]v, | ||
"acknowledge": %[4]v, | ||
"assignments": %[4]v | ||
} | ||
} | ||
EOF | ||
} | ||
`, name, extension_name, restrict, notify_types) | ||
} |