// Module included in the following assemblies:
//
// * cloud_experts_tutorials/cloud-experts-getting-started/cloud-experts-getting-started-deploying/cloud-experts-getting-started-detailed-cli-guide.adoc

:_mod-docs-content-type: PROCEDURE
[id="cloud-experts-getting-start-detailed-cli-deployment-automatic_{context}"]
= Creating a cluster with automatic mode

[role="_abstract"]
Use this method if you want the {rosa-cli} to automate the creation of the roles and policies to create your cluster quickly. If this is the _first time_ you are deploying {product-title} in this account and you have _not_ yet created the account roles, then create the account-wide roles and policies, including Operator policies.

.Procedure
. Run the following command to create the account-wide roles:
+
[source,terminal]
----
rosa create account-roles --mode auto --yes
----
+
**Example output**
+
[source,terminal]
----
I: Creating roles using 'arn:aws:iam::000000000000:user/rosa-user'
I: Created role 'ManagedOpenShift-ControlPlane-Role' with ARN 'arn:aws:iam::000000000000:role/ManagedOpenShift-ControlPlane-Role'
I: Created role 'ManagedOpenShift-Worker-Role' with ARN 'arn:aws:iam::000000000000:role/ManagedOpenShift-Worker-Role'
I: Created role 'ManagedOpenShift-Support-Role' with ARN 'arn:aws:iam::000000000000:role/ManagedOpenShift-Support-Role'
I: Created role 'ManagedOpenShift-Installer-Role' with ARN 'arn:aws:iam::000000000000:role/ManagedOpenShift-Installer-Role'
I: Created policy with ARN 'arn:aws:iam::000000000000:policy/ManagedOpenShift-openshift-machine-api-aws-cloud-credentials'
I: Created policy with ARN 'arn:aws:iam::000000000000:policy/ManagedOpenShift-openshift-cloud-credential-operator-cloud-crede'
I: Created policy with ARN 'arn:aws:iam::000000000000:policy/ManagedOpenShift-openshift-image-registry-installer-cloud-creden'
I: Created policy with ARN 'arn:aws:iam::000000000000:policy/ManagedOpenShift-openshift-ingress-operator-cloud-credentials'
I: Created policy with ARN 'arn:aws:iam::000000000000:policy/ManagedOpenShift-openshift-cluster-csi-drivers-ebs-cloud-credent'
I: To create a cluster with these roles, run the following command:
    rosa create cluster --sts
----

. Run the following command to create a cluster with all the default options:
+
[source,terminal]
----
rosa create cluster --cluster-name <cluster-name> --sts --mode auto --yes
----
+
[NOTE]
====
This will also create the required Operator roles and OIDC provider. If you want to see all available options for your cluster use the `--help` flag or `--interactive` for interactive mode.
====
+
**Example input**
+
[source,terminal]
----
$ rosa create cluster --cluster-name my-rosa-cluster --sts --mode auto --yes
----
+
**Example output**
+
[source,terminal]
----
I: Creating cluster 'my-rosa-cluster'
I: To view a list of clusters and their status, run 'rosa list clusters'
I: Cluster 'my-rosa-cluster' has been created.
I: Once the cluster is installed you will need to add an Identity Provider before you can login into the cluster. See 'rosa create idp --help' for more information.
I: To determine when your cluster is Ready, run 'rosa describe cluster -c my-rosa-cluster'.
I: To watch your cluster installation logs, run 'rosa logs install -c my-rosa-cluster --watch'.
Name:                       my-rosa-cluster
ID:                         1mlhulb3bo0l54ojd0ji000000000000
External ID:                
OpenShift Version:          
Channel Group:              stable
DNS:                        my-rosa-cluster.ibhp.p1.openshiftapps.com
AWS Account:                000000000000
API URL:                    
Console URL:                
Region:                     us-west-2
Multi-AZ:                   false
Nodes:
- Master:                  3
- Infra:                   2
- Compute:                 2
Network:
- Service CIDR:            172.30.0.0/16
- Machine CIDR:            10.0.0.0/16
- Pod CIDR:                10.128.0.0/14
- Host Prefix:             /23
STS Role ARN:               arn:aws:iam::000000000000:role/ManagedOpenShift-Installer-Role
Support Role ARN:           arn:aws:iam::000000000000:role/ManagedOpenShift-Support-Role
Instance IAM Roles:
- Master:                  arn:aws:iam::000000000000:role/ManagedOpenShift-ControlPlane-Role
- Worker:                  arn:aws:iam::000000000000:role/ManagedOpenShift-Worker-Role
Operator IAM Roles:
- arn:aws:iam::000000000000:role/my-rosa-cluster-openshift-image-registry-installer-cloud-credentials
- arn:aws:iam::000000000000:role/my-rosa-cluster-openshift-ingress-operator-cloud-credentials
- arn:aws:iam::000000000000:role/my-rosa-cluster-openshift-cluster-csi-drivers-ebs-cloud-credentials
- arn:aws:iam::000000000000:role/my-rosa-cluster-openshift-machine-api-aws-cloud-credentials
- arn:aws:iam::000000000000:role/my-rosa-cluster-openshift-cloud-credential-operator-cloud-credential-oper
State:                      waiting (Waiting for OIDC configuration)
Private:                    No
Created:                    Oct 28 2021 20:28:09 UTC
Details Page:               https://console.redhat.com/openshift/details/s/1wupmiQy45xr1nN000000000000
OIDC Endpoint URL:          https://rh-oidc.s3.us-east-1.amazonaws.com/1mlhulb3bo0l54ojd0ji000000000000
----
+
The default settings are as follows:

* Nodes:
** 3 control plane nodes
** 2 infrastructure nodes
** 2 worker nodes
** No autoscaling
* Region: As configured for the `aws` CLI
* Networking IP ranges:
** Machine CIDR: 10.0.0.0/16
** Service CIDR: 172.30.0.0/16
** Pod CIDR: 10.128.0.0/14
* New VPC
* Default AWS KMS key for encryption
* The most recent version of OpenShift available to `rosa`
* A single availability zone
* Public cluster

. Run one of the following commands to check the status of your cluster:
+
* For a detailed view of the status, run:
+
[source,terminal]
----
rosa describe cluster --cluster <cluster-name>
----
* For an abridged view of the status, run:
+
[source,terminal]
----
rosa list clusters
----

. The cluster state will change from “waiting” to “installing” to "ready". This will take about 40 minutes.
. Once the state changes to “ready” your cluster is installed.