User Tools

Site Tools


wiki:aws_cli_commands

This is an old revision of the document!


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.1730105741.txt.gz · Last modified: 2024/10/28 09:55 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