just print ec2 instances
$ AWS_REGION=us-west-1 findinstance
# of instances: 5
+-------------+-----------------+---------------------------------------------------+---------+
| instance_id | name | start | status |
+-------------+-----------------+---------------------------------------------------+---------+
| i-XXXXXXXXX | XXXXXXXXX | aws ec2 start-instances --instance-ids=i-XXXXXXXXX | stopped |
+-------------+-----------------+---------------------------------------------------+---------+
| i-XXXXXXXXX | XXXXXXXXX | aws ec2 start-instances --instance-ids=i-XXXXXXXXX | stopped |
+-------------+-----------------+---------------------------------------------------+---------+
| i-XXXXXXXXX | XXXXXXXXX | aws ec2 start-instances --instance-ids=i-XXXXXXXXX | running |
+-------------+-----------------+---------------------------------------------------+---------+
| i-XXXXXXXXX | XXXXXXXXX | aws ec2 start-instances --instance-ids=i-XXXXXXXXX | stopped |
+-------------+-----------------+---------------------------------------------------+---------+
| i-XXXXXXXXX | XXXXXXXXX | aws ec2 start-instances --instance-ids=i-XXXXXXXXX | stopped |
+-------------+-----------------+---------------------------------------------------+---------+
- clone this repository.
- bundle install --path vendor/bundle
- put some wrapper script in
~/bin
or somewhere you like.
#!/bin/sh
bundle exec ruby ~/src/github.com/kazup0n/instance-finder/instance-finder.rb