terraform-provider-datadog
terraform-provider-datadog copied to clipboard
[Feature Request] Unable to import a PagerDuty service object
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.
Facing the same issue. Any chance it will be fixed soon?
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.
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.
I notified the related team so they could update the endpoint accordingly.
Hi, I know this is pretty old, but still relevant, any news about it?
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.