// Module included in the following assemblies:
//
// * networking/networking_operators/aws-load-balancer-operator.adoc

:_mod-docs-content-type: PROCEDURE
[id="aws-load-balancer-operator-environment_{context}"]
= Set up temporary environment variables

[role="_abstract"]
You have the option to set up temporary environment variables to hold resource identifiers and configuration details. Using temporary environment variables streamlines the process of running the installation commands for the AWS Load Balancer Operator.

If you do not want to use environment variables to store certain values, you can manually enter those values in the relevant installation commands.

.Prerequisites

* You have installed the AWS CLI (`aws`).
* You have installed the {oc-first}. 

.Procedure

. Log in to your cluster as a cluster administrator using the {oc-first}.
+
[source,terminal]
----
$ oc login --token=<token> --server=<cluster_url>
----

. Run the following commands to set up environment variables.
+
[source,terminal]
----
$ export CLUSTER_NAME=$(oc get infrastructure cluster -o=jsonpath="{.status.apiServerURL}" | sed  's|^https://||' | awk -F . '{print $2}')
----
+
[source,terminal]
----
$ export REGION=$(oc get infrastructure cluster -o=jsonpath="{.status.platformStatus.aws.region}")
----
+
[source,terminal]
----
$ export OIDC_ENDPOINT=$(oc get authentication.config.openshift.io cluster -o jsonpath='{.spec.serviceAccountIssuer}' | sed  's|^https://||')
----
+
[source,terminal]
----
$ export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
----
+
[source,terminal]
----
$ export SCRATCH="/tmp/${CLUSTER_NAME}/alb-operator"
----
+
[source,terminal]
----
$ mkdir -p ${SCRATCH}
----
+
These commands create environment variables that you can use in this terminal session to pass their values to the command line interface.

. Verify that the environment variables have correct values by running the following command:
+
[source,terminal]
----
$ echo "Cluster name: ${CLUSTER_NAME}
Region: ${REGION}
OIDC Endpoint: ${OIDC_ENDPOINT}
AWS Account ID: ${AWS_ACCOUNT_ID}"
----
+
.Example output
[source,terminal]
----
Cluster name: <cluster_id>
Region: <region>
OIDC Endpoint: oidc.op1.openshiftapps.com/<oidc_id>
AWS Account ID: <aws_id>
----

. Use the same terminal session to continue with AWS Load Balancer Operator installation, to ensure that your environment variables are not lost.
