// Module included in the following assemblies:
//
// * rosa_learning/creating_cluster_workshop/learning-getting-started-support.adoc
:_mod-docs-content-type: PROCEDURE
[id="learning-getting-started-deleting-cli_{context}"]
= Deleting a {product-title} cluster using the CLI

[role="_abstract"]
You can delete your cluster using the {rosa-cli}.

.Procedure
. *Optional:* List your clusters to make sure you are deleting the correct one by running the following command:
+
[source,terminal]
----
$ rosa list clusters
----

. Delete a cluster by running the following command:
+
[source,terminal]
----
$ rosa delete cluster --cluster <cluster-name>
----
+
[WARNING]
====
This command is non-recoverable.
====

. The CLI prompts you to confirm that you want to delete the cluster. Press *y* and then *Enter*. The cluster and all its associated infrastructure will be deleted.
+
[NOTE]
====
All AWS STS and IAM roles and policies will remain and must be deleted manually once the cluster deletion is complete by following the steps below.
====

. The CLI outputs the commands to delete the OpenID Connect (OIDC) provider and Operator IAM roles resources that were created. Wait until the cluster finishes deleting before deleting these resources. Perform a quick status check by running the following command:
+
[source,terminal]
----
$ rosa list clusters
----

. Once the cluster is deleted, delete the OIDC provider by running the following command:
+
[source,terminal]
----
$ rosa delete oidc-provider -c <clusterID> --mode auto --yes
----

. Delete the Operator IAM roles by running the following command:
+
[source,terminal]
----
$ rosa delete operator-roles -c <clusterID> --mode auto --yes
----
+
[NOTE]
====
This command requires the cluster ID and not the cluster name.
====

. Only remove the remaining account roles if they are no longer needed by other clusters in the same account. If you want to create other ROSA clusters in this account, do not perform this step.
+
To delete the account roles, you need to know the prefix used when creating them. The default is "ManagedOpenShift" unless you specified otherwise.
+
Delete the account roles by running the following command:
+
[source,terminal]
----
$ rosa delete account-roles --prefix <prefix> --mode auto --yes
----