mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
47 lines
1.6 KiB
Plaintext
47 lines
1.6 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * hosted-control-planes/hcp-destroy/hcp-destroy-aws.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="hcp-destroy-aws-cli_{context}"]
|
|
= Destroying a hosted cluster on {aws-short} by using the CLI
|
|
|
|
You can use the command-line interface (CLI) to destroy a hosted cluster on {aws-first}.
|
|
|
|
.Procedure
|
|
|
|
. Delete the managed cluster resource on {mce-short} by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc delete managedcluster <hosted_cluster_name> <1>
|
|
----
|
|
<1> Replace `<hosted_cluster_name>` with the name of your cluster.
|
|
|
|
. Delete the hosted cluster and its backend resources by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ hcp destroy cluster aws \
|
|
--name <hosted_cluster_name> \// <1>
|
|
--infra-id <infra_id> \// <2>
|
|
--role-arn <arn_role> \// <3>
|
|
--sts-creds <path_to_sts_credential_file> \// <4>
|
|
--base-domain <basedomain> <5>
|
|
----
|
|
+
|
|
<1> Specify the name of your hosted cluster, for instance, `example`.
|
|
<2> Specify the infrastructure name for your hosted cluster.
|
|
<3> Specify the Amazon Resource Name (ARN), for example, `arn:aws:iam::820196288204:role/myrole`.
|
|
<4> Specify the path to your {aws-short} Security Token Service (STS) credentials file, for example, `/home/user/sts-creds/sts-creds.json`.
|
|
<5> Specify your base domain, for example, `example.com`.
|
|
+
|
|
[IMPORTANT]
|
|
====
|
|
If your session token for {aws-short} Security Token Service (STS) is expired, retrieve the STS credentials in a JSON file named `sts-creds.json` by running the following command:
|
|
[source,terminal]
|
|
----
|
|
$ aws sts get-session-token --output json > sts-creds.json
|
|
----
|
|
====
|