// Module included in the following assemblies:
//
// * rosa_cluster_admin/autonode/rosa-autonode-setup.adoc

:_mod-docs-content-type: PROCEDURE
[id="rosa-nodes-autonode-managing-enable-ui_{context}"]
= Enable the {autonode} using {cluster-manager}

[role="_abstract"]
Enable the {autonode} on your cluster by using {cluster-manager} after it finishes installing.

.Prerequisites
* You have created an AWS Identity and Access Management (IAM) role to be configured for the {autonode}.
* You have your cluster's OpenID Connect (OIDC) Endpoint URL.
+ 
[NOTE]
====
Run `rosa describe cluster -c $CLUSTER_NAME | grep "OIDC Endpoint URL"` to see this URL. Do not include the `https://` prefix from the OIDC Endpoint URL. For example, use  `example-oidc-endpoint.cloudfront.net/abcd1234examplehash5678` instead of `https://example-oidc-endpoint.cloudfront.net/abcd1234examplehash5678`.
====
* You have the proper credentials to access the AWS console.

.Procedure

. Export your AWS ID:
+
[source,terminal]
----
$ export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
----

. Log in to the link:https://console.aws.amazon.com/[AWS console]. 
. In the AWS console, navigate to **IAM > Roles**.
. On your {autonode} Amazon Resource Name (ARN), update the trust policy to include the following policy specifications:
+
[NOTE]
====
To access this ARN, run:

[source,terminal]
----
$ echo $ROLE_ARN
----
====
+
[source,json]
----
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Federated": "arn:aws:iam::<aws_account_id>:oidc-provider/<oidc-endpoint-URL>"
            },
            "Action": "sts:AssumeRoleWithWebIdentity",
            "Condition": {
                "StringEquals": {
                    "<oidc-endpoint-URL>:sub": "system:serviceaccount:kube-system:karpenter"
                }
            }
        }
    ]
}
----
where:
<aws_account_id>::
Specifies your AWS Account ID. 
<oidc-endpoint-URL>::
Specifies the OIDC endpoint URL that you acquired.

. In {cluster-manager-url}, select your cluster from the cluster list.
. On the cluster details screen, select the **Edit** button next to the status for the {autonode}. 
. On the **Edit Autonode settings** dialog box, toggle **Enable Autonode**.
. Add your {autonode} IAM role ARN to the field in this dialog box.
. Select **Save** to save your configurations and close the **Edit Autonode settings** box.

.Verification

. Log in to the cluster:
+
[source,terminal,subs="+quotes"]
----
$ oc login <api_url> --username cluster-admin --password <password>
----

. Verify that the {autonode} custom resource definitions (CRDs) are present:
+
[source,terminal]
----
$ oc get ec2nodeclass
----
+
.Example output
[source,terminal]
----
NAME      READY   AGE
default   True    5m
----
+
[source,terminal]
----
$ oc get openshiftec2nodeclass
----
+
.Example output
[source,terminal]
----
NAME      READY
default   True
----