Skip to content

Instantly share code, notes, and snippets.

@thiagoeh
Last active March 20, 2019 13:37
Show Gist options
  • Select an option

  • Save thiagoeh/cc424d1c343f9133067d7aa48183f7b6 to your computer and use it in GitHub Desktop.

Select an option

Save thiagoeh/cc424d1c343f9133067d7aa48183f7b6 to your computer and use it in GitHub Desktop.
# Listing external IP adresses of all running instances
aws ec2 describe-instances --query "Reservations[*].Instances[*].PublicIpAddress" --output=text
# https://docs.aws.amazon.com/cli/latest/userguide/cli-services-ec2-instances.html
aws ec2 describe-instances --filters "Name=instance-type,Values=t2.micro" --query "Reservations[].Instances[].InstanceId"
aws ec2 describe-instances --query "Reservations[].Instances[].InstanceId"
aws ec2 stop-instances --instance-ids i-0344384533d4263ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment