// Module included in the following assemblies:
//
// * hosted-control-planes/hcp-deploy/hcp-deploy-aws.adoc

:_mod-docs-content-type: PROCEDURE
[id="hcp-access-hc-aws_{context}"]
= Accessing a hosted cluster on {aws-short}

[role="_abstract"]
After you create a hosted cluster on {aws-short}, you can access it by using your `kubeconfig` file, access secrets, and `kubeadmin` credentials.

The hosted cluster namespace contains hosted cluster resources and the access secrets. The hosted control plane runs in the hosted control plane namespace.

The secret name formats are shown in the following table:

.Access secrets
[cols="3",options="header"]
|===
|Secret |Format |Example

|`kubeconfig` secret
|`<hosted_cluster_namespace>-<name>-admin-kubeconfig`
|`clusters-hypershift-demo-admin-kubeconfig`

|`kubeadmin` password secret
|`<hosted_cluster_namespace>-<name>-kubeadmin-password`
|`clusters-hypershift-demo-kubeadmin-password`
|===

[NOTE]
====
The `kubeadmin` password secret is Base64-encoded and the `kubeconfig` secret contains a Base64-encoded `kubeconfig` configuration. You must decode the Base64-encoded `kubeconfig` configuration and save it into a `<hosted_cluster_name>.kubeconfig` file.
====

.Procedure

. Generate the `kubeconfig` file by entering the following command:
+
[source,terminal]
----
$ hcp create kubeconfig --namespace <hosted_cluster_namespace> \
  --name <hosted_cluster_name> > <hosted_cluster_name>.kubeconfig
----

. Use your `<hosted_cluster_name>.kubeconfig` file that contains the decoded `kubeconfig` configuration to access the hosted cluster. Enter the following command:
+
[source,terminal]
----
$ oc --kubeconfig <hosted_cluster_name>.kubeconfig get nodes
----
+
You must decode the `kubeadmin` password secret to log in to the API server or the console of the hosted cluster.