equinix / terraform-provider-equinix

Terraform Equinix provider
https://deploy.equinix.com/labs/terraform-provider-equinix/
MIT License
46 stars 45 forks source link

[Bug]: Some resources may be incorrectly ignoring HTTP 403 responses #788

Closed ctreatma closed 1 week ago

ctreatma commented 1 month ago

Description

The Metal API can return an HTTP 403 for a read request on a Metal device that fails during provisioning or deprovisioning. Due to this API behavior, the metal_device resource in some cases treats a 403 response as a deleted device:

As far as I know, Metal devices are the only resources that exhibit this behavior, and that other resources should treat 403 responses as errors rather than deletions. However, numerous other resources are also configured to ignore 403 errors during the resource lifecycle and/or when sweeping test resources:

Searching this repo for "Forbidden" gives a better view of how broadly we ignore 403s.

Is this intentional behavior? Is it valid? I don't see any documentation that mentions these special error cases.

New or Affected Terraform Resources

equinix_metal_vlan equinix_metal_virtual_circuit ...and more

Potential Terraform Configuration

No response