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

Unable to manually delete a resource that no longer exists because of dependents #11177

Closed
markfickett opened this issue Oct 28, 2022 · 1 comment
Labels
kind/enhancement Improvements or new features resolution/duplicate This issue is a duplicate of another issue

Comments

@markfickett
Copy link

What happened?

I created an EKS cluster with a FargateProfile via Pulumi. Then I switched to a new EKS cluster (different resource name) with a managed node group instead. When I ran Pulumi Up, it couldn't delete the Fargate profile, so I manually went in the AWS console UI and deleted the profile (by accepting a dialog which warned that it would also delete running nodes).

So I was left in the state where I had most of an EKS cluster to destroy, but no Fargate cluster in reality. I tried pulumi state delete on the Fargate profile's URN, but I got an error that "This resource can't be safely deleted because the following resources depend on it" citing the EKS cluster top-level resource. I also tried using --force though I saw on another ticket that's about "protected" resources and I guess dependents are a different concept.

I was able to use pulumi refresh, which deleted the Fargate profile from my state.

Steps to reproduce

  • Create EKS cluster with custom Fargate profile
  • Destroy EKS cluster => error destroying Fargate profile
  • Manually delete Fargate profile from AWS console UI
  • Expected: manually delete state for Fargate profile
  • Observed: cannot delete

Expected Behavior

I would expect pulumi state delete not to be constrained, because I am using it to reflect reality, and if in reality I am have deleted the Fargate profile w/o also deleting the rest of the EKS cluster resources, I should be able to modify the state. I am confused that pulumi refresh is allowed to make that edit even though pulumi state delete was not.

Actual Behavior

When I pulumi state deleted a single resource that I had already manually deleted, I got an error.

Also when I did a pulumi refresh on my stack, it seems to have incorrectly updated another part of my stack and now there's an IAM group that it's trying to create that already exists, which was not happening before.

Output of pulumi about

$ pulumi about
CLI
Version 3.38.0
Go Version go1.19
Go Compiler gc

Plugins
NAME VERSION
aws 5.7.2
awsx 1.0.0-beta.11
docker 3.4.1
eks 0.42.5
honeycomb 0.0.11
kubernetes 3.22.0
python unknown

Host
OS ubuntu
Version 20.04
Arch x86_64

Additional context

Related to:

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@markfickett markfickett added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 28, 2022
@iwahbe
Copy link
Member

iwahbe commented Oct 31, 2022

Thanks for brining this up. This problem was just fixed in 3.45.0 by #11164. You can now run pulumi state delete --target-dependents which does what you suggest.

@iwahbe iwahbe added kind/enhancement Improvements or new features resolution/duplicate This issue is a duplicate of another issue and removed kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 31, 2022
@iwahbe iwahbe closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features resolution/duplicate This issue is a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants