How to get an EKS Cluster name from an AWS Region

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

EKS_CLUSTER_NAME=$(aws eks list-clusters --region us-west-2 --query clusters[0] --output text) echo $EKS_CLUSTER_NAME
Code language: Bash (bash)
Tags:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments