-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Terraform 1.3.4 - errors for deleted resources after partial destroy #32185
Copy link
Copy link
Closed
Description
Terraform Version
Terraform v1.3.4
on windows_amd64
+ provider registry.terraform.io/aliyun/alicloud v1.190.0
+ provider registry.terraform.io/hashicorp/null v3.2.0Terraform Configuration Files
Sample code to reproduce the issue
Debug Output
TF debug logs for the second destroy run
Expected Behavior
destroy operation doesn't validate references to already deleted resources
Actual Behavior
references to non-existing (already deleted) resources are validated during destroy operation, resulting in an exception
Steps to Reproduce
The issue happens on TF destroy operation after a failure (when previous destroy run managed to delete some of the resources, but not all).
To reproduce:
- terraform apply
- manually create a resource that will block VPC deletion
- run first terraform destroy -> will delete everything except the VPC, VPC deletion will fail (see gist)
- run second terraform destroy -> will fail because of references to non-existing resources (those deleted by the previous partial destroy run) - see gist
Additional Context
The issue doesn't happen with Terraform 1.2.9 - second destroy attempt is successful.
The issue is not limited to just outputs validation, we get similar errors in other places (see gist)
References
Same issue as #31975, but happens in Terraform 1.3.4 (that was supposed to fix it)
Reactions are currently unavailable