-
-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
Hello @antonbabenko , thanks for the skill! It's quite useful :)
I have tested it a bit, and as a suggestion, we could add something mentioning that it's not really possible to remove all the resources of a provider, and the provider itself in a single PR.
This is what is suggested by my current Cursor for example:
## Provider Removal Pattern
**Critical**: When removing a provider, you cannot delete it while resources managed by that provider still exist in Terraform state. This applies to ALL providers.
### Two-Phase Removal Process
**Phase 1: Destroy Resources (Keep Provider)**
1. Remove resource definitions from code (delete resource blocks)
2. Keep provider in `versions.tf` and variables in `vars.tf`
3. Run `terraform plan` - should show resources being destroyed
4. Run `terraform apply` to destroy resources
5. Verify resources are removed from state
**Phase 2: Remove Provider (After Resources Destroyed)**
1. Remove provider from `versions.tf`
2. Remove provider variables from `vars.tf`
3. Delete provider configuration files
4. Run `terraform init -upgrade` to update lock file
5. Verify `terraform plan` shows no errors
**Why this matters:**
- Terraform needs the provider available to destroy resources it manages
- Removing provider before destroying resources causes errors
- This pattern applies universally to all Terraform providers
Thank you!
Jules
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels