|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * installing/installing_aws/uninstalling-cluster-aws.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="installation-aws-delete-cluster"] |
| 7 | += Deleting a cluster with a configured AWS Local Zone infrastructure |
| 8 | + |
| 9 | +After you install a cluster on Amazon Web Services (AWS) into an existing Virtual Private Cloud (VPC), and you set subnets for each Local Zone location, you can delete the cluster and any AWS resources associated with it. |
| 10 | + |
| 11 | +The example in the procedure assumes that you created a VPC and its subnets by using a CloudFormation template. |
| 12 | + |
| 13 | +.Prerequisites |
| 14 | + |
| 15 | +* You know the name of the CloudFormation stacks, `<local_zone_stack_name>` and `<vpc_stack_name>`, that were used during the creation of the network. You need the name of the stack to delete the cluster. |
| 16 | +* You have access rights to the directory that contains the installation files that were created by the installation program. |
| 17 | +* Your account includes a policy that provides you with permissions to delete the CloudFormation stack. |
| 18 | +
|
| 19 | +.Procedure |
| 20 | + |
| 21 | +. Change to the directory that contains the stored installation program, and delete the cluster by using the `destroy cluster` command: |
| 22 | ++ |
| 23 | +[source,terminal] |
| 24 | +---- |
| 25 | +$ ./openshift-install destroy cluster --dir <installation_directory> \//<1> |
| 26 | + --log-level=debug <2> |
| 27 | +---- |
| 28 | +<1> For `<installation_directory>`, specify the directory that stored any files created by the installation program. |
| 29 | +<2> To view different log details, specify `error`, `info`, or `warn` instead of `debug`. |
| 30 | + |
| 31 | +. Delete the CloudFormation stack for the Local Zone subnet: |
| 32 | ++ |
| 33 | +[source,terminal] |
| 34 | +---- |
| 35 | +$ aws cloudformation delete-stack --stack-name <local_zone_stack_name> |
| 36 | +---- |
| 37 | + |
| 38 | +. Delete the stack of resources that represent the VPC: |
| 39 | ++ |
| 40 | +[source,terminal] |
| 41 | +---- |
| 42 | +$ aws cloudformation delete-stack --stack-name <vpc_stack_name> |
| 43 | +---- |
| 44 | + |
| 45 | +.Verification |
| 46 | + |
| 47 | +* Check that you removed the stack resources by issuing the following commands in the AWS CLI. The AWS CLI outputs that no template component exists. |
| 48 | ++ |
| 49 | +[source,terminal] |
| 50 | +---- |
| 51 | +$ aws cloudformation describe-stacks --stack-name <local_zone_stack_name> |
| 52 | +---- |
| 53 | ++ |
| 54 | +[source,terminal] |
| 55 | +---- |
| 56 | +$ aws cloudformation describe-stacks --stack-name <vpc_stack_name> |
| 57 | +---- |
0 commit comments