You can use the aws cli to get the EKS cluster name, parse the first result and return it into a variable.

1
2
EKS_CLUSTER_NAME=$(aws eks list-clusters --region us-west-2 --query clusters[0] --output text)
echo $EKS_CLUSTER_NAME