PagerDuty / terraform-provider-pagerduty

Terraform PagerDuty provider
https://www.terraform.io/docs/providers/pagerduty/
Mozilla Public License 2.0
205 stars 210 forks source link

LogDNA pagerduty_vendor changed to Mezmo #553

Open mriedem opened 2 years ago

mriedem commented 2 years ago

Terraform Version

$ terraform -v
Terraform v1.2.6
on linux_amd64
+ provider registry.terraform.io/ibm-cloud/ibm v1.44.0-beta0
+ provider registry.terraform.io/logdna/logdna v1.8.0
+ provider registry.terraform.io/pagerduty/pagerduty v2.4.0
+ provider registry.terraform.io/sysdiglabs/sysdig v0.5.30

Affected Resource(s)

pagerduty_vendor

Terraform Configuration Files

data "pagerduty_vendor" "logdna" {
  name = "LogDNA"
}

Debug Output

n/a

Panic Output

n/a

Expected Behavior

Unchanged pagerduty_vendor should have continued working. I would expect something in the pagerduty terraform provider to not just drop the logdna vendor support, but at least deprecate it and internally transition to mezmo.

Actual Behavior

Got this error during plan:

 Error: Unable to locate any vendor with the name: LogDNA
│ 
│   with data.pagerduty_vendor.logdna,
│   on main.tf line 76, in data "pagerduty_vendor" "logdna":
│   76: data "pagerduty_vendor" "logdna" {

Steps to Reproduce

Define that data source and do terraform plan.

Important Factoids

logdna was renamed to mezmo; logdna no longer shows up here but mezmo does:

https://www.pagerduty.com/integrations/

The fix for us was changing to this:

data "pagerduty_vendor" "logdna" {
  name = "Mezmo"
}

References

mriedem commented 2 years ago

It seems this code could check if the name provided is LogDNA and alias it to Mezmo before doing the vendor search query:

https://github.com/PagerDuty/terraform-provider-pagerduty/blob/e251ef8c6f37a3ea91d054c98ffa9973af820d08/pagerduty/data_source_pagerduty_vendor.go#L40

It'd be nice to have that kind of alias shim for compatibility, even if it was immediately deprecated but then people would have some time to migrate, though of course maybe it's not very useful because you'd still be broken on older provider versions (like us).