Skip to content
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

pagerduty_incident_workflow_trigger condition incorrectly reguired when type is conditional #924

Open
PitcherIT opened this issue Aug 14, 2024 · 0 comments

Comments

@PitcherIT
Copy link

Terraform Version

Terraform v1.7.4
PagerDuty provider 3.15.2

Affected Resource(s)

pagerduty_incident_workflow_trigger

Terraform Configuration Files

resource "pagerduty_incident_workflow" "test_workflow" {
  name         = "Test Condition Triggered Incident"
  description  = "This Incident Workflow is an example"
  step {
    name           = "Send Status Update"
    action         = "pagerduty.com:incident-workflows:send-status-update:1"
    input {
      name = "Message"
      value = "Example status message sent on {{current_date}}"
    }
  }
}

resource "pagerduty_incident_workflow_trigger" "automatic_trigger" {
  type                       = "conditional"
  workflow                   = pagerduty_incident_workflow.test_workflow.id
  condition                  = null
  subscribed_to_all_services = true
}

Expected Behavior

Trigger is created and shows as "When incident is created" in the PagerDuty UI

Actual Behavior

Trigger cannot be created as condition is incorrectly required if type = "conditional"

Error: when trigger type conditional is used, condition must be specified

Steps to Reproduce

  1. terraform plan

Important Factoids

Conditional trigger supports two options in the UI:

  • When incident is created
  • When conditions are met
    When setting "When incident is created", that trigger from in the API returns condition as "" (null), and on a Terrafrom import shows it as null.
# __generated__ by Terraform
resource "pagerduty_incident_workflow_trigger" "testtrigger" {
  condition                  = null
  services                   = ["PX49EAW"]
  subscribed_to_all_services = false
  type                       = "conditional"
  workflow                   = "PA9Z9U3"
  permissions {
    restricted = false
    team_id    = null
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant