Destroying
Use the Cloud-Native Toolkit environment to delete itself
Not only can the Cloud-Native Toolkit create the environment, the environment can also delete itself. The
environment is installed using Terraform, which stores the state of the applied modules in the workspace/{cluster name}
folder. Terraform can use that state to delete what it installed.
Destroy a environment following these steps:
Run the following command to launch a Developer Tools container:
./launch.shIn the container, change to the
workspace/{cluster name}
directory:cd workspace/{cluster name}In the container, run the
destroy.sh
script to apply the Terraform destroy:./destroy.shRather than directly running
terraform desroy
, thedestroy.sh
script first builds a “destroy plan” from the current state then applies that plan. Performing the destroy in this way is more reliable and allows for certain resources to be selectively destroyed/saved.