1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/rosa-sts-cluster-terraform-setup.adoc
2025-08-13 22:09:21 +00:00

56 lines
1.8 KiB
Plaintext

// Module included in the following assemblies:
//
// * rosa_hcp/terraform/rosa-hcp-creating-a-cluster-quickly-terraform.adoc
// * rosa_install_access_delete_clusters/terraform/rosa-classic-creating-a-cluster-quickly-terraform.adoc
//
ifeval::["{context}" == "rosa-classic-creating-a-cluster-quickly-terraform"]
:tf-classic-defaults:
endif::[]
ifeval::["{context}" == "rosa-hcp-creating-a-cluster-quickly-terraform"]
:tf-hcp-defaults:
endif::[]
:_content-type: PROCEDURE
[id="rosa-sts-cluster-terraform-setup_{context}"]
= Preparing your environment for Terraform
Before you can create your {product-title} cluster by using Terraform, you need to export your link:https://console.redhat.com/openshift/token[offline {cluster-manager-first} token].
.Procedure
. *Optional*: Because the Terraform files get created in your current directory during this procedure, you can create a new directory to store these files and navigate into it by running the following command:
+
[source,terminal]
----
$ mkdir terraform-cluster && cd terraform-cluster
----
. Grant permissions to your account by using link:https://console.redhat.com/openshift/token[an offline {cluster-manager-first} token].
. Copy your offline token, and set the token as an environmental variable by running the following command:
+
[source,terminal]
----
$ export RHCS_TOKEN=<your_offline_token>
----
+
[NOTE]
====
This environmental variable resets at the end of each session, such as restarting your machine or closing the terminal.
====
.Verification
* After you export your token, verify the value by running the following command:
+
[source,terminal]
----
$ echo $RHCS_TOKEN
----
ifeval::["{context}" == "rosa-classic-creating-a-cluster-quickly-terraform"]
:!tf-classic-defaults:
endif::[]
ifeval::["{context}" == "rosa-hcp-creating-a-cluster-quickly-terraform"]
:!tf-hcp-defaults:
endif::[]