Table of Contents

, , ,

aws cli commands

List all active load balancers v2 (Application and Network Load Balancers)

for region in $(aws ec2 describe-regions --query "Regions[*].RegionName" --output text --region eu-central-1); do     echo "Region: $region";     aws elbv2 describe-load-balancers --region "$region" --query "LoadBalancers[*].{Name:LoadBalancerName,DNS:DNSName}" --output table; done

List all active classic load balancers

for region in $(aws ec2 describe-regions --query "Regions[*].RegionName" --output text --region eu-central-1); do     echo "Region: $region";     aws elb describe-load-balancers --region "$region" --query "LoadBalancers[*].{Name:LoadBalancerName,DNS:DNSName}" --output table; done

List all Elastic Kubernetes Clusters

for region in $(aws ec2 describe-regions --region eu-central-1 --query "Regions[*].RegionName" --output text); do
  echo "Region: $region"
  for cluster in $(aws eks list-clusters --region "$region" --query "clusters" --output text); do
      aws eks describe-cluster --name "$cluster" --region "$region" --query "cluster.{Name:name, Status:status, Version:version, Endpoint:endpoint}" --output table
  done

done

Tested on

See also

References