terraform-provider-pagerduty icon indicating copy to clipboard operation
terraform-provider-pagerduty copied to clipboard

PagerDuty Change Event transformer integrations are not supported

Open DoctorPolski opened this issue 2 years ago • 2 comments

Terraform Version

1.3.7 - I see nothing in later changelogs that addresses this.

Affected Resource(s)

  • pagerduty_service_integration

Terraform Configuration Files

resource "pagerduty_service_integration" "example" {
  service           = pagerduty_service.service.id
  name              = "Example Name"
  type              = "change_event_transform_inbound_integration" // <- Problem
  vendor            = null
  integration_key   = null
  integration_email = null
}

Debug Output

https://gist.github.com/DoctorPolski/e08d0104f41e1029b0731c4fbaacf12e

Expected Behavior

Resource should be created.

Actual Behavior

Resource could not be created.

Steps to Reproduce

  1. Create a Custom Change Event Transformer integration on an existing technical service on the PagerDuty Console
  2. Import this into a skeleton pagerduty_service_integration resource
  3. Plan
  4. Observe in plan that PagerDuty console has created the integration with type of change_event_transform_inbound_integration
  5. Update resource to use this type
  6. Plan or Apply and observe that Terraform demands the type be from a list which does contain change_event_transform_inbound_integration

Important Factoids

I believe this is simply a case of the provider not keeping up to date with the range of possible generic integration types now offered by PagerDuty.

DoctorPolski avatar Feb 17 '23 16:02 DoctorPolski

That type isn't an option via the PagerDuty API either: image https://developer.pagerduty.com/api-reference/43e0864d370fb-create-a-new-integration

However, you can use the vendor argument with the name Custom Change Event Transformer instead of type:

data "pagerduty_vendor" "main" {
  name = "Custom Change Event Transformer"
}

resource "pagerduty_service_integration" "main" {
  name    = "Custom change event"
  service = "P123456"
  vendor  = data.pagerduty_vendor.main.id
}

Imported into state the data/resources will be similar to: image

image

This may be of limited use to you though, as the config field isn't exposed via the API either, so you can't configure custom JS code. Refs:

  • Closed TF provider issues:
    • https://github.com/PagerDuty/terraform-provider-pagerduty/issues/539
  • Docs for transformer with note on new preferred method: https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTc5-custom-event-transformer

modwyer42 avatar Mar 01 '23 22:03 modwyer42

@modwyer42 I tried this and it works perfectly. Thank you.

And yes, it really would be helpful if we could access the config to allow the management of the required JS.

DoctorPolski avatar May 02 '23 08:05 DoctorPolski