# Part 5: Deprovision

## What Will You Do

In part 5, you will:

- Deprovision the EKS cluster and all associated infrastructure in AWS

Watch a video of this exercise.

Deprovision EKS Cluster: Getting Started with Rafay Terraform Provider for EKS - YouTube

[Deprovision EKS Cluster: Getting Started with Rafay Terraform Provider for EKS](https://www.youtube.com/watch?v=O5KHAsS_BPk)

## Assumptions

This part assumes that you have completed [Part 1](https://docs.rafay.co/learn/quickstart/eks/clusterlifecycle/provision/) of this series and have a successfully provisioned and healthy EKS cluster.

---

## Deprovision Cluster

Select a method to provision and manage your EKS cluster from the tabs below.

- Go to Infrastructure -> Clusters.
- Click on the settings icon of the cluster and select "Delete"
- When prompted, select "yes" to confirm the deletion of the cluster

- The cluster provision status will show " INFRA DELETION IN PROGRESS". Note, it can take approximately 20 minutes for the deletion to finish
- Once the deletion is complete, the cluster will be removed from the web console

Let us first list the EKS cluster using the RCTL CLI

```
./rctl get cluster
```

You should expect to see output like the following

```
+------------------+---------+-----------+----------------------------+
| NAME             | TYPE    | OWNERSHIP | PROVISION STATUS           |
+------------------+---------+-----------+----------------------------+
| demo-eks-testing | aws-eks | self      | CLUSTER_PROVISION_COMPLETE |
+------------------+---------+-----------+----------------------------+
```

Now, execute the following command to delete your EKS cluster.

```
./rctl delete demo-eks-testing
```

Note

The actual deletion process can take ~10 minutes to ensure that all associated infrastructure resources in AWS is deleted as well.

## Step 1: Deprovision Cluster

In this step, we will deprovision the EKS cluster with a Terraform command. The controller will cleanup all cluster components in your Azure account.

- Execute the following command to begin deprovisioning the cluster.

```
terraform destroy
```

- Enter `yes` when prompted.

The cluster provision status will show " INFRA DELETION IN PROGRESS". Note, it can take approximately 10 minutes for the deletion to finish.
- Once the deletion is complete, the cluster will be removed from the web console

---

## Recap

Congratulations! At this point, you have successfully deprovisioned the EKS cluster and all associated infrastructure components in your AWS account.
