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

[Feature Request] Unable to import a PagerDuty service object

Open eloraburns opened this issue 4 years ago • 4 comments

Terraform Version

0.12.24

Affected Resource(s)

  • datadog_integration_pagerduty_service_object

Expected Behavior

I can define an existing resource and import it.

Actual Behavior

Import of PagerDuty service objects is not supported.

eloraburns avatar May 11 '20 18:05 eloraburns

Facing the same issue. Any chance it will be fixed soon?

alinagol avatar Jun 11 '20 15:06 alinagol

Hi, were you able to import service objects before? It seems to me that it was only possible to import whole integrations using the datadog_integration_pagerduty resource.

gzussa avatar Jun 16 '20 15:06 gzussa

Hi, were you able to import service objects before? It seems to me that it was only possible to import whole integrations using the datadog_integration_pagerduty resource.

I don't think it was possible to import service objects before, but my 2 cents is that it should be possible from a UX perspective. If it's not possible (e.g. for some technical reason) then a note should be left on the resource's documentation page explaining that.

DWSR avatar Jun 16 '20 17:06 DWSR

I notified the related team so they could update the endpoint accordingly.

gzussa avatar Jun 19 '20 13:06 gzussa

Hi, I know this is pretty old, but still relevant, any news about it?

ruben-chainalysis avatar Feb 15 '24 15:02 ruben-chainalysis

I'll answer my own question.

Looks like the API can already do what's needed and a minor tweak of the provider does the trick to enable importing an existing resource.

Why is this needed.

An existing integration resource can cause Bad request errors only visible at apply time. Getting out of this situation can be tricky: import doesn't currently work, as per this issue. Trying to destroy for later recreation doesn't work because the resource is not in the state. The permission structure of PagerDuty can make it hard to do this for the user with limited access (especially if relying on a pipeline to apply the TF).

Workaround

By running a local copy of the provider with a small modification to add an importer, I was able to import the resource.

See the changes in this PR.

ruben-chainalysis avatar Feb 19 '24 12:02 ruben-chainalysis