-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AA-1837 Add only_invocable_on_unresolved_incidents to Automation Action's schema. #945
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,11 @@ func resourcePagerDutyAutomationActionsAction() *schema.Resource { | |
Computed: true, | ||
Optional: true, | ||
}, | ||
"only_invocable_on_unresolved_incidents": { | ||
Type: schema.TypeBool, | ||
Computed: true, | ||
Optional: true, | ||
}, | ||
}, | ||
} | ||
} | ||
|
@@ -153,6 +158,11 @@ func buildAutomationActionsActionStruct(d *schema.ResourceData) (*pagerduty.Auto | |
automationActionsAction.ModifyTime = &val | ||
} | ||
|
||
if attr, ok := d.GetOk("only_invocable_on_unresolved_incidents"); ok { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
val := attr.(bool) | ||
automationActionsAction.OnlyInvocableOnUnresolvedIncidents = &val | ||
} | ||
|
||
return &automationActionsAction, nil | ||
} | ||
|
||
|
@@ -298,6 +308,10 @@ func resourcePagerDutyAutomationActionsActionRead(d *schema.ResourceData, meta i | |
if automationActionsAction.ActionClassification != nil { | ||
d.Set("action_classification", &automationActionsAction.ActionClassification) | ||
} | ||
|
||
if automationActionsAction.OnlyInvocableOnUnresolvedIncidents != nil { | ||
d.Set("only_invocable_on_unresolved_incidents", &automationActionsAction.OnlyInvocableOnUnresolvedIncidents) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As |
||
} | ||
} | ||
return nil | ||
}) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ func TestAccPagerDutyAutomationActionsActionTypeProcessAutomation_Basic(t *testi | |
resource.TestCheckResourceAttrSet("pagerduty_automation_actions_action.foo", "modify_time"), | ||
resource.TestCheckResourceAttrSet("pagerduty_automation_actions_action.foo", "runner_id"), | ||
resource.TestCheckResourceAttr("pagerduty_automation_actions_action.foo", "runner_type", "runbook"), | ||
resource.TestCheckResourceAttr("pagerduty_automation_actions_action.foo", "only_invocable_on_unresolved_incidents", "true"), | ||
), | ||
}, | ||
{ | ||
|
@@ -84,6 +85,7 @@ func TestAccPagerDutyAutomationActionsActionTypeProcessAutomation_Basic(t *testi | |
resource.TestCheckResourceAttrSet("pagerduty_automation_actions_action.foo", "modify_time"), | ||
resource.TestCheckResourceAttrSet("pagerduty_automation_actions_action.foo", "runner_id"), | ||
resource.TestCheckResourceAttr("pagerduty_automation_actions_action.foo", "runner_type", "runbook"), | ||
resource.TestCheckResourceAttr("pagerduty_automation_actions_action.foo", "only_invocable_on_unresolved_incidents", "true"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please, test the "false" value here setting explicitly the value in |
||
), | ||
}, | ||
}, | ||
|
@@ -127,6 +129,7 @@ func TestAccPagerDutyAutomationActionsActionTypeScript_Basic(t *testing.T) { | |
resource.TestCheckResourceAttrSet("pagerduty_automation_actions_action.foo", "modify_time"), | ||
resource.TestCheckNoResourceAttr("pagerduty_automation_actions_action.foo", "runner_type"), | ||
resource.TestCheckNoResourceAttr("pagerduty_automation_actions_action.foo", "runner_id"), | ||
resource.TestCheckNoResourceAttr("pagerduty_automation_actions_action.foo", "only_invocable_on_unresolved_incidents"), | ||
), | ||
}, | ||
{ | ||
|
@@ -152,6 +155,7 @@ func TestAccPagerDutyAutomationActionsActionTypeScript_Basic(t *testing.T) { | |
resource.TestCheckResourceAttrSet("pagerduty_automation_actions_action.foo", "modify_time"), | ||
resource.TestCheckNoResourceAttr("pagerduty_automation_actions_action.foo", "runner_type"), | ||
resource.TestCheckNoResourceAttr("pagerduty_automation_actions_action.foo", "runner_id"), | ||
resource.TestCheckNoResourceAttr("pagerduty_automation_actions_action.foo", "only_invocable_on_unresolved_incidents"), | ||
), | ||
}, | ||
}, | ||
|
@@ -214,7 +218,8 @@ resource "pagerduty_automation_actions_action" "foo" { | |
process_automation_job_id = "pa_job_id_123" | ||
process_automation_job_arguments = "-arg 1" | ||
process_automation_node_filter = "tags: production" | ||
} | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The trailing comma is breaking the test |
||
only_invocable_on_unresolved_incidents = "true" | ||
} | ||
`, actionName, actionName) | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use
=
instead of: