User Tools

Site Tools


wiki:aws_cli_commands

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

  • aws-cli/2.12.5 Python/3.11.4 Linux/6.8.0-47-generic exe/x86_64.ubuntu.22 prompt/off

See also

References

wiki/aws_cli_commands.txt · Last modified: 2024/10/29 13:58 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki