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

Handle deleted out of context resources gracefully #223

Closed
jamiezieziula opened this issue Jun 27, 2024 · 2 comments
Closed

Handle deleted out of context resources gracefully #223

jamiezieziula opened this issue Jun 27, 2024 · 2 comments
Assignees
Labels
bug Something isn't working development open-source

Comments

@jamiezieziula
Copy link
Contributor

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

1.8.2

Affected Resource(s)

  • prefect_block

Debug Output

Screenshot 2024-06-27 at 10 45 00 AM

Panic Output

Expected Behavior

If a resource is deleted out of context (in this case, directly in the UI), Terraform should detect that and attempt to re-create it (or in my case, remove the resource from the state file).

Actual Behavior

Terraform throws a 404 error because it cannot locate the resource

Steps to Reproduce

  1. Create a Prefect block via Terraform
  2. Delete the block directly in the UI
  3. Re-run the terraform plan
@jamiezieziula jamiezieziula added the bug Something isn't working label Jun 27, 2024
@mitchnielsen mitchnielsen changed the title Handle deleted out of context resources gracefulle Handle deleted out of context resources gracefully Jul 2, 2024
@jamiezieziula jamiezieziula added the Migrated label Aug 28, 2024 — with Linear
@jamiezieziula jamiezieziula removed Migrated bug Something isn't working labels Aug 28, 2024
@armona
Copy link

armona commented Nov 17, 2024

Any update on this? We are experiencing the same issue.

@mitchnielsen
Copy link
Contributor

Thanks for resurfacing this one. I believe this one aligns with #260 - I'll copy the tl;dr here for visibility:

TL;DR: from what I've seen so far, this is expected behavior and you can use terraform state rm to remove the Work Pool from Terraform's state, and then run the plan again to recreate the resource. If anyone has further evidence to the contrary, or if we get enough requests, I'm completely open to revisiting this.

@mitchnielsen mitchnielsen self-assigned this Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working development open-source
Projects
None yet
Development

No branches or pull requests

3 participants