Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonwarner-pd committed Jul 4, 2024
1 parent 7bdd60f commit 091e8fa
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ func buildEventOrchestrationPathGlobalRuleActionsSchema() map[string]*schema.Sch
Optional: true,
}

a["escalation_policy"] = &schema.Schema{
Type: schema.TypeString,
Optional: true,
}

return a
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func TestAccPagerDutyEventOrchestrationPathGlobal_Basic(t *testing.T) {
Config: testAccCheckPagerDutyEventOrchestrationGlobalDefaultConfig(team, escalationPolicy, service, orch),
Check: resource.ComposeTestCheckFunc(baseChecks...),
},

// Adding/updating/deleting automation_action properties
{
Config: testAccCheckPagerDutyEventOrchestrationPathGlobalAutomationActionsConfig(team, escalationPolicy, service, orch),
Expand Down Expand Up @@ -276,7 +277,7 @@ func createBaseGlobalOrchConfig(t, ep, s, o string) string {
`, t, ep, s, o)
}

func testAccCheckPagerDutyEventOrchestrationGlobalDefaultConfig(t, ep, s, o string) string {
func testAccCheckPagerDutyEventOrchestrationGlobalDefaultConfigDefaultConfig(t, ep, s, o string) string {
return fmt.Sprintf("%s%s", createBaseGlobalOrchConfig(t, ep, s, o),
`resource "pagerduty_event_orchestration_global" "my_global_orch" {
event_orchestration = pagerduty_event_orchestration.orch.id
Expand All @@ -291,6 +292,27 @@ func testAccCheckPagerDutyEventOrchestrationGlobalDefaultConfig(t, ep, s, o stri
`)
}

func testAccCheckPagerDutyEventOrchestrationGlobalDefaultWithEscalationPolicy(t, ep, s, o string) string {
return fmt.Sprintf("%s%s", createBaseGlobalOrchConfig(t, ep, s, o),
`resource "pagerduty_event_orchestration_global" "my_global_orch" {
event_orchestration = pagerduty_event_orchestration.orch.id
catch_all {
actions {}
}
set {
id = "start"
rule {
label = "rule 1"
actions {
"escalation_policy": "POLICY"
}
}
}
}
`)
}

func testAccCheckPagerDutyEventOrchestrationPathGlobalAutomationActionsConfig(t, ep, s, o string) string {
return fmt.Sprintf("%s%s", createBaseGlobalOrchConfig(t, ep, s, o),
`resource "pagerduty_event_orchestration_global" "my_global_orch" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ func buildEventOrchestrationPathServiceRuleActionsSchema() map[string]*schema.Sc
Optional: true,
}

a["escalation_policy"] = &schema.Schema{
Type: schema.TypeString,
Optional: true,
}

return a
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 091e8fa

Please sign in to comment.