Last active
December 1, 2016 03:57
-
-
Save debo/773f1cdcc323dec2fc94b0b23a9eb9de to your computer and use it in GitHub Desktop.
Useful CLI comands to ssh into or terminate your AWS EC2 instances without AWS Console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws ec2 describe-instances --filter Name=tag:Name,Values='[query]' --profile=[profile] --region=[region] | jq '.Reservations[].Instances[].PrivateIpAddress'| sed 's/"//g' | sed 's/null//g' | sed '/^\s*$/d' | sort | |
aws ec2 describe-instances --filter Name=tag:Name,Values='[query]' --profile=[profile] --region=[region] | jq '.Reservations[].Instances[].InstanceId'| sed 's/"//g' | sort | |
aws ec2 terminate-instances --instance-ids [instanceId] --profile=[profile] --region=[region] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment