Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

equinix_metal_device 403s on failed provision are not detected #233

Closed
displague opened this issue Jul 27, 2022 · 1 comment · Fixed by #235
Closed

equinix_metal_device 403s on failed provision are not detected #233

displague opened this issue Jul 27, 2022 · 1 comment · Fixed by #235

Comments

@displague
Copy link
Member

displague commented Jul 27, 2022

Metal devices may fail to provision due to hardware failures, provisioning timeouts, or other reasons. When this happens the metal instance may no longer be available through the API and the user may receive a 403 response. Terraform should treat this as a failed provision and the device should be considered deleted.

This is generally done here: https://github.com/equinix/terraform-provider-equinix/blob/master/equinix/resource_metal_device.go#L812-L831

But there may be some other scenarios, such as deprovision, where a device is moved into this 403 state. In these events, the "Read" function should be prepared to handle 403s and treat them as deletes, especially if the delete that resulted in a deprovision failure happened outside of Terraform's control loops.

https://github.com/equinix/terraform-provider-equinix/blob/master/equinix/resource_metal_device.go#L586-L591

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Terraform Version

Affected Resource(s)

  • equinix_metal_device

Terraform Configuration Files

# Copy-paste your Terraform configurations here.
#
# For large Terraform configs, please use a service like Dropbox and share a link to the ZIP file.
#
# If reproducing the bug involves modifying the config file (e.g., apply a config,
# change a value, apply the config again, see the bug), then please include both:
# * the version of the config before the change, and
# * the version of the config after the change.

Debug Output

Panic Output

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. terraform apply

References

  • #0000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant