// Module included in the following assemblies:
//
// * cloud_experts_tutorials/cloud-experts-aws-load-balancer-operator.adoc

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

[role="_abstract"]
Set environment variables for your cluster name, region, and OpenID Connect (OIDC) endpoint to ensure consistency across AWS Load Balancer Operator commands.

.Prerequisites

ifndef::openshift-rosa-hcp[]
* You have created a link:https://docs.redhat.com/en/documentation/red_hat_openshift_service_on_aws_classic_architecture/4/html-single/install_rosa_classic_clusters/index#rosa-sts-creating-a-cluster-quickly[multi-availability zone (AZ) {product-title} cluster].
endif::openshift-rosa-hcp[]
ifdef::openshift-rosa-hcp[]
* You have created a link:https://docs.redhat.com/en/documentation/red_hat_openshift_service_on_aws/4/html-single/install_clusters/index#rosa-hcp-sts-creating-a-cluster-quickly[multi-availability zone (AZ) {product-title} cluster].
endif::openshift-rosa-hcp[]
+
[NOTE]
====
AWS Application Load Balancers (ALBs) require a multi-AZ cluster and three public subnets split across three AZs in the same Virtual Private Cloud (VPC) as the cluster. This makes ALBs unsuitable for many PrivateLink clusters. AWS Network Load Balancers (NLBs) do not have this restriction.
====
+
* You have created a Bring Your Own (BYO) VPC cluster.
* You have access to the AWS CLI (`aws`).
* You have access to the {oc-first}.

.Procedure
* Prepare the environment variables:
+
[source,terminal]
----
$ export AWS_PAGER=""
$ export ROSA_CLUSTER_NAME=$(oc get infrastructure cluster -o=jsonpath="{.status.infrastructureName}"  | sed 's/-[a-z0-9]\{5\}$//')
$ export REGION=$(oc get infrastructure cluster -o=jsonpath="{.status.platformStatus.aws.region}")
$ export OIDC_ENDPOINT=$(oc get authentication.config.openshift.io cluster -o jsonpath='{.spec.serviceAccountIssuer}' | sed  's|^https://||')
$ export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
$ export SCRATCH="/tmp/${ROSA_CLUSTER_NAME}/alb-operator"
$ mkdir -p ${SCRATCH}
$ echo "Cluster: ${ROSA_CLUSTER_NAME}, Region: ${REGION}, OIDC Endpoint: ${OIDC_ENDPOINT}, AWS Account ID: ${AWS_ACCOUNT_ID}"
----