|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * rosa_install_access_delete_clusters/rosa-sts-creating-a-cluster-quickly-terraform.adoc |
| 4 | +// |
| 5 | +ifeval::["{context}" == "rosa-sts-creating-a-cluster-quickly-terraform"] |
| 6 | +:tf-defaults: |
| 7 | +endif::[] |
| 8 | +:_content-type: PROCEDURE |
| 9 | + |
| 10 | +[id="sd-terraform-cluster-destroy_{context}"] |
| 11 | += Deleting your ROSA cluster with Terraform |
| 12 | + |
| 13 | +Use the `terraform destroy` command to remove all of the resources that were created with the `terraform apply` command. |
| 14 | + |
| 15 | +[NOTE] |
| 16 | +==== |
| 17 | +Do not modify your Terraform `.tf` files |
| 18 | +ifndef::tf-defaults[] |
| 19 | +or the `terraform.tfvars` file |
| 20 | +endif::tf-defaults[] |
| 21 | +before destroying your resources. These variables are matched to resources to delete. |
| 22 | +==== |
| 23 | + |
| 24 | +.Procedure |
| 25 | +. In the directory where you ran the `terraform apply` command to create your cluster, run the following command to delete the cluster: |
| 26 | ++ |
| 27 | +[source,terminal] |
| 28 | +---- |
| 29 | +$ terraform destroy |
| 30 | +---- |
| 31 | +ifndef::tf-defaults[] |
| 32 | ++ |
| 33 | +[IMPORTANT] |
| 34 | +==== |
| 35 | +After you enter the name of the ROSA cluster and confirm destruction by entering `yes`, you cannot stop the `terraform destroy` process. Your account, Operator roles, and cluster are deleted. |
| 36 | +==== |
| 37 | + |
| 38 | +. Enter the name of the cluster that you want to delete: |
| 39 | ++ |
| 40 | +[source,terminal] |
| 41 | +---- |
| 42 | +var.cluster_name |
| 43 | + Provide the name of your ROSA cluster. |
| 44 | +
|
| 45 | + Enter a value: <name_of_rosa_cluster> <1> |
| 46 | +---- |
| 47 | +-- |
| 48 | +<1> A valid value is the name of the ROSA cluster you want to delete. |
| 49 | +-- |
| 50 | +endif::tf-defaults[] |
| 51 | + |
| 52 | +. Enter `yes` to start the role and cluster deletion: |
| 53 | ++ |
| 54 | +.Example output of Terraform confirmation: |
| 55 | +[source,terminal] |
| 56 | +---- |
| 57 | +Plan: 0 to add, 0 to change, 39 to destroy. |
| 58 | +
|
| 59 | +Do you really want to destroy all resources? |
| 60 | + Terraform will destroy all your managed infrastructure, as shown above. |
| 61 | + There is no undo. Only 'yes' will be accepted to confirm. |
| 62 | +
|
| 63 | + Enter a value: yes |
| 64 | +---- |
| 65 | + |
| 66 | +.Verification |
| 67 | +. Verify that your cluster was destroyed by running the following command: |
| 68 | ++ |
| 69 | +[source,terminal] |
| 70 | +---- |
| 71 | +$ rosa list clusters |
| 72 | +---- |
| 73 | ++ |
| 74 | +.Example output showing no cluster |
| 75 | +[source,terminal] |
| 76 | +---- |
| 77 | +I: No clusters available |
| 78 | +---- |
| 79 | + |
| 80 | +. Verify that the account roles were destroyed by running the following command: |
| 81 | ++ |
| 82 | +[source,terminal] |
| 83 | +---- |
| 84 | +$ rosa list account-roles |
| 85 | +---- |
| 86 | ++ |
| 87 | +.Example output showing no Terraform-created account roles: |
| 88 | +[source,terminal] |
| 89 | +---- |
| 90 | +I: Fetching account roles |
| 91 | +I: No account roles available |
| 92 | +---- |
| 93 | + |
| 94 | +. Verify that the Operator roles were destroyed by running the following command: |
| 95 | ++ |
| 96 | +[source,terminal] |
| 97 | +---- |
| 98 | +$ rosa list operator-roles |
| 99 | +---- |
| 100 | ++ |
| 101 | +.Example output showing no Terraform-created Operator roles: |
| 102 | +[source,terminal] |
| 103 | +---- |
| 104 | +I: Fetching operator roles |
| 105 | +I: No operator roles available |
| 106 | +---- |
| 107 | +ifeval::["{context}" == "rosa-sts-creating-a-cluster-quickly-terraform"] |
| 108 | +:!tf-defaults: |
| 109 | +endif::[] |
0 commit comments