Destroying the Resources
Understand how to manage the destruction of Azure Kubernetes Service resources with Terraform. This lesson guides you through selectively deleting the AKS cluster while keeping the Terraform state storage intact. You will learn to use Terraform's targeted destroy commands to efficiently clean up resources without losing important state data, preparing you for further exercises in managing AKS clusters.
We'll cover the following...
Destroying the resources
We’re (almost) finished with the quick exploration of Terraform using AKS as an example. We saw how to add and change resources, and the only thing missing is to see how to destroy them.
If we want to delete some of the resources, all we’d have to do is remove their definitions and execute terraform apply. However, in some cases, we might want to destroy everything. There’s a command for that as well. However, in this specific case, we might not want to destroy everything.
We need to keep the storage where the Terraform state is stored. ...