Destroy Jobs
How Tendril executes DESTROY jobs — terraform destroy with state cleanup.
Destroy Jobs
DESTROY jobs tear down all infrastructure provisioned by a vine.
Execution Flow
Assume cloud credentials
Same as other job types.
terraform init
Initializes with the S3 backend to download the existing state file.
terraform destroy
terraform destroy -auto-approveRemoves all resources tracked in the Terraform state. No confirmation prompt — the user already confirmed via the UI or CLI.
State cleanup
The state file in Supabase S3 is left in place (empty or minimal) for audit purposes.
Report results
Job status → SUCCESS. Vine status is set to DESTROYED.
Partial Destroy Recovery
If the destroy fails mid-way (e.g., resource dependency, timeout):
- Terraform state reflects which resources were already destroyed
- The job is marked FAILED with the error message
- User retries — the next destroy only attempts the remaining resources
- This continues until all resources are removed
What Gets Destroyed
Everything provisioned by the vine:
- VPC/VNet and all networking resources (subnets, NAT gateways, security groups)
- Kubernetes cluster (EKS/GKE/AKS) and node groups
- Databases (Aurora/Cloud SQL/Azure Database instances)
- Caches (ElastiCache/Memorystore/Azure Cache)
- NoSQL tables, queues, topics
- Container registries
- Secrets
- DNS records and certificates
- WAF rules
- IAM roles (IRSA)
Destroy is permanent for stateful resources. Database data, cache contents, and secret values are lost. Terraform state is preserved so re-apply is possible, but the data is gone.