Destroying a hosted cluster on AWS
You can destroy a hosted cluster and its managed cluster resource on Amazon Web Services (AWS) by using the command-line interface (CLI).
Destroying a hosted cluster on AWS by using the CLI
You can use the command-line interface (CLI) to destroy a hosted cluster on Amazon Web Services (AWS).
Procedure
-
Delete the managed cluster resource on multicluster engine Operator by running the following command:
$ oc delete managedcluster <hosted_cluster_name>- Replace
<hosted_cluster_name>with the name of your cluster.
- Replace
-
Delete the hosted cluster and its backend resources by running the following command:
$ hcp destroy cluster aws \ --name <hosted_cluster_name> \ --infra-id <infra_id> \ --role-arn <arn_role> \ --sts-creds <path_to_sts_credential_file> \ --base-domain <basedomain>- Specify the name of your hosted cluster, for instance,
example. - Specify the infrastructure name for your hosted cluster.
- Specify the Amazon Resource Name (ARN), for example,
arn:aws:iam::820196288204:role/myrole. - Specify the path to your AWS Security Token Service (STS) credentials file, for example,
/home/user/sts-creds/sts-creds.json. - Specify your base domain, for example,
example.com.Important
If your session token for AWS Security Token Service (STS) is expired, retrieve the STS credentials in a JSON file named
sts-creds.jsonby running the following command:$ aws sts get-session-token --output json > sts-creds.json
- Specify the name of your hosted cluster, for instance,