Deploying a ROSA HCP cluster with Terraform
This content is authored by Red Hat experts, but has not yet been tested on every supported configuration.
This guide will walk you through deploying a ROSA HCP cluster using Terraform. This is a great way to get started with ROSA and to automate the deployment of your clusters.
Pre-requisites
-
You need the
gitbinary installed on your machine. You can download it from the git website . -
You need to have the
terraformbinary installed on your machine. You can download it from the Terraform website . -
You need to have the
jqbinary installed on your machine. You can download it from the jq website . -
You need to have the
ocbinary installed on your machine. You can download it from the OpenShift website . -
You need to have the
rosabinary installed on your machine. You can download it from the ROSA website . -
You need to have an OpenShift Cluster Manager (OCM) account. You can sign up for an account on the OCM website .
-
Get an OCM API token. You can do this by logging into OCM and going to the API tokens page .
-
You need to log in to OCM and create a refresh token. You can do this by running the following command:
Use the OCM API token you created in the previous step to log in.
HCP ROSA Cluster
-
Clone down the terraform repository
-
Save some environment variables
Mac
Linux
Note: You may want to customize some of these settings to match your needs. see the
variables.tffile for options. -
Create a Plan and Apply it
If everything goes to plan, after about 20 minutes you should have a cluster available to use.
-
Log into OpenShift