Skip to content

Instantly share code, notes, and snippets.

@davecowart
Last active November 13, 2015 18:58
Show Gist options
  • Save davecowart/64dd5e187257f3d35c8c to your computer and use it in GitHub Desktop.
Save davecowart/64dd5e187257f3d35c8c to your computer and use it in GitHub Desktop.
ec2-search
davec@Busters ~
% which ec2-rdp !10511
ec2-rdp () {
~/ec2-search.sh $1 $2 | xargs ~/rdp.sh
}
davec@Busters ~
% cat ec2-search.sh !10512
#!/bin/bash
environment=$1
instance_purpose=$2
aws ec2 describe-instances --filters "Name=tag:environment,Values=$environment" "Name=tag:instance-purpose,Values=$instance_purpose" --query "Reservations[0].Instances[0].InstanceId"
ec2-rdp tycheuat NotificationService-background-worker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment