Skip to content

Instantly share code, notes, and snippets.

@blackpioter
Last active June 13, 2017 09:51
Show Gist options
  • Save blackpioter/990ac56fe27092b05f2467cff9481d70 to your computer and use it in GitHub Desktop.
Save blackpioter/990ac56fe27092b05f2467cff9481d70 to your computer and use it in GitHub Desktop.
AWS CS
## AWS show instance count by type
aws ec2 describe-instances --filters Name=instance-state-name,Values=running --output json | jq ".Reservations[].Instances[].InstanceType" | sort | uniq -c | sort -n
## AWS List instances in table
aws ec2 describe-instances --output table --query 'Reservations[].Instances[].[Tags[?Key==`Name`] | [0].Value, State.Name]'
## AWS List running instances in table
aws ec2 describe-instances --output table --query 'Reservations[].Instances[].[Tags[?Key==`Name`] | [0].Value, PublicIpAddress, PrivateIpAddress , InstanceType, SubnetId ]' --filters Name=instance-state-name,Values=running
## AWS EC2 limits for account / region
https://eu-west-1.console.aws.amazon.com/ec2/v2/home?region=eu-west-1#Limits:
## AWS remove bucket and its content (doesn't work on versioned bucket)
aws s3 rb s3://bucket_name --force --profile profile_name
## AWS show ELB private IPs
aws ec2 describe-network-interfaces --filters "Name=description,Values=ELB your-elb-name" | jq ".NetworkInterfaces[].PrivateIpAddresses[].PrivateIpAddress"
@nabobnagari
Copy link

how to get to know EC2 limits Through Command line for each and every region

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment