Skip to content

Resource datadog_software_catalog fails violently when resource has already been deleted from UI #3230

@adrianclay

Description

@adrianclay

Datadog Terraform Provider Version

v3.57.0

Terraform Version

v1.12.2

What resources or data sources are affected?

datadog_software_catalog

Terraform Configuration Files

Relevant debug or panic output

no entity is found in the response,
path=/api/vZ/catalog/entity?include=raw_schema&filter[ref]=xxxxxx
response={"data": [], "meta" : {"count":0, "includeCount":0}, "links":{"self":"/api/v2/catalog/entity?filter%5Bref%5D=xxxxxx\u0026include=raw_schema\u0026page%5B1imit%5D=100\u0026page%5Boffset%5D=0"}}

Expected Behavior

Terraform is able to gracefully handle that the resource has been deleted and suggest creating it again.

Actual Behavior

Provider blows up with no entity is found in the response error.

The datadog provider MUST gracefully handle resources being deleted outside of Terraform.

Steps to Reproduce

  1. Create a datadog_software_catalog resource
  2. Run terraform apply
  3. Delete the created catalogue entry from within the DataDog UI
  4. Run terraform apply again

Important Factoids

There appears to be code within the provider to handle a 404 response gracefully, but according to the corresponding docs a 404 response is not possible.

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions