Destroy fails when AWS resources cannot be found
See original GitHub issueWhen destroying a k8s cluster, if for some reason an AWS resource gets removed and Pulumi isn’t aware of it, it will ultimately cause the destroy to fail if it cannot find the resource:
$ pul destroy
Previewing destroy (eks-demo):
Type Name Plan
- pulumi:pulumi:Stack eks-hello-world-eks-demo delete
- ├─ eks:index:Cluster helloWorld delete
- │ ├─ pulumi-nodejs:dynamic:Resource helloWorld-cfnStackName delete
- │ ├─ eks:index:ServiceRole helloWorld-eksRole delete
- │ └─ eks:index:ServiceRole helloWorld-instanceRole delete
- └─ aws-infra:network:Network vpc delete
- ├─ aws:ec2:InternetGateway vpc delete
- ├─ aws:ec2:Eip vpc-nat-1 delete
- ├─ aws:ec2:Eip vpc-nat-0 delete
- └─ aws:ec2:Vpc vpc delete
Resources:
- 10 to delete
Do you want to perform this destroy? yes
Destroying (eks-demo):
Type Name Status Info
pulumi:pulumi:Stack eks-hello-world-eks-demo
- └─ aws:ec2:InternetGateway vpc **deleting failed** 1 error
Diagnostics:
aws:ec2:InternetGateway (vpc):
error: Plan apply failed: deleting urn:pulumi:eks-demo::eks-hello-world::aws-infra:network:Network$aws:ec2/internetGateway:InternetGateway::vpc: Error waiting for internet gateway (igw-0305d3fc89e01176e) to detach: couldn't find resource (31 retries)
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Destroy AWS resources of a failed/canceled Terraform apply
I did a quick test and even terraform apply failed in the middle, it still keeps completed resources in terraform.tfstate. File main.tf
Read more >Resource manually deleted, now cant Destroy, Plan or ...
Hello, we have an unfortunate situation where a user deleted an AWS resource which should have been locked, and now we want to...
Read more >Troubleshooting common AWS CDK issues
When deploying my AWS CDK stack, I receive a NoSuchBucket error ... My S3 bucket, DynamoDB table, or other resource is not deleted...
Read more >How to troubleshoot 5 common Terraform errors
Terraform may destroy or change existing resources if your state is out of ... terraform validate Error: Missing resource instance key on ...
Read more >aws_iam_user | Resources | hashicorp/aws
The aws_iam_user_policy_attachment resource (recommended) does not have this ... will fail to be destroyed. tags - Key-value map of tags for the IAM...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Does
pulumi refreshhelp in this case?Is the scenario that the
InternetGateway(or other resource) is manually deleted from AWS behind the scenes? If so, curious what is the desired/suggested behaviour in this case?I’m going to close this out - as I believe the original issue is expected, and requires that the user do
pulumi refreshorpulumi state deleteto reconcile their checkpoint with the cloud provider prior topulumi destroy.https://github.com/pulumi/pulumi/issues/2247 is tracking doing a refresh automatically prior to preview/update/destroy. That would be the only thing that could fundamentally “solve” the original issue here.
The other issues referenced along the way sound like unrelated potential bugs, but there are not details on repro steps for those here. Let’s open new issues on those if needed.