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

Timeouts are not honored on Metal resources/data sources #357

Closed
7 tasks done
aayushrangwala opened this issue Aug 15, 2023 · 0 comments · Fixed by #377
Closed
7 tasks done

Timeouts are not honored on Metal resources/data sources #357

aayushrangwala opened this issue Aug 15, 2023 · 0 comments · Fixed by #377

Comments

@aayushrangwala
Copy link
Contributor

aayushrangwala commented Aug 15, 2023

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

v1.5.4

Affected Resource(s)

  • Metal Devices resource and datasource
  • Metal ports
  • Metal VRF
  • Network Device
  • SSH Key and a few more

Terraform Configuration Files

resource "equinix_metal_device" "device" {
  hostname         = "tf-device"
  plan             = var.plan
  metro            = var.metro
  operating_system = var.os
  billing_cycle    = "hourly"
  project_id       = var.project_id
#
  depends_on = [ equinix_metal_project_ssh_key.public_key ]

  timeouts {
    create = "5s"
  }
}

References

Some of the Metal resources/data sources (for example, the equinix_metal_device resource) indicate support for timeouts in their docs and schema, but do not actually support those timeouts.

Per terraform-plugin-sdk v2 docs, we should be using CreateContext, DeleteContext, etc. functions in order to have terraform automatically handle timeouts on our behalf: https://developer.hashicorp.com/terraform/plugin/sdkv2/guides/v2-upgrade-guide#more-support-for-context-context

Also, for the resources and datasources when the context aware timeouts would not be suitable, use Hashicorp's WaitForStateContext

We should find any Metal resources & data sources that have a Timeouts schema property and ensure that those resources & data sources use context-aware CRUD functions.

Tasks

Upgrade resources and data sources to support context aware or without context CRUD timeouts

ctreatma pushed a commit that referenced this issue Aug 30, 2023
Provides support for timeouts in Create, Update and Delete for Metal
Device as already mentioned in the documents
#357
ctreatma added a commit that referenced this issue Sep 21, 2023
ctreatma added a commit that referenced this issue Sep 25, 2023
As part of fixing the timeouts for metal resources to actually comply
with what is documented, it was found out that we donot document any
timeout support for metal VRF whereas in the code we do have support for
timeouts.

Since it has never been working due to the below issue, also not
documented, it'll be ideal to remove it directly considering a code
smell

Relates to: #357
ctreatma pushed a commit that referenced this issue Sep 26, 2023
This PR will fix the timeout support for metal spot market requests
which is already documented publicly

relates to:
#357
ctreatma pushed a commit that referenced this issue Sep 27, 2023
- Adds support for timeout in Create, update and delete operation.
- Adds acceptance tests

Fixes #357

---------

Signed-off-by: Ayush Rangwala <[email protected]>
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