ec2manage 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +74 -0
  2. data/bin/ec2manage +10 -0
  3. data/lib/ec2manage.rb +7 -0
  4. metadata +123 -0
data/README.md ADDED
@@ -0,0 +1,74 @@
1
+ ec2manage
2
+ =========
3
+
4
+ ec2manage is a command line tool for managing EC2 instances.
5
+
6
+ It's main goal is to provide the same style of control as the Amazon EC2 API Tools but with additional structure and metadata make administrative decisions easier.
7
+
8
+ Installation
9
+ ============
10
+
11
+ gem install ec2manage
12
+
13
+ ec2manage will read your `EC2_PRIVATE_KEY` and `EC2_CERT` environment variables if you've already defined them for the Amazon EC2 API Tools. Or if you only plan to use ec2manage, you can just drop your `pk-*.pem` and `cert-*.pem` in `~/.ec2manage`.
14
+
15
+ ec2manage uses SDB for storing nicknames for instances and volumes so you'll need to also have your SDB access credentials available.
16
+
17
+ Usage
18
+ =====
19
+
20
+ Creating machines
21
+ -----------------
22
+
23
+ Create a new Ubuntu 9 machine with 10GB blank EBS on /dev/sdi1 nicknamed "beta" in the web security group:
24
+
25
+ > ec2manage create -z us-east-1d -a ami-bb709dd2 -k my-keypair \
26
+ -g web -v 10 -s snap-6a0a8c03 -d sdi -n beta
27
+
28
+ Of course, specifying this every time would be tedious, so you can also build machine templates in JSON. The above machine would look like this:
29
+
30
+ { "zone": "us-east-1d",
31
+ "ami": "ami-bb709dd2",
32
+ "keypair": "my-keypair",
33
+ "group": "web",
34
+ "volumes": [
35
+ { "size": 10,
36
+ "snapshot": "snap-6a0a8c0",
37
+ "device": "sdi" }
38
+ ] }
39
+
40
+ You can save this template as a file and load it with `-t`:
41
+
42
+ > ec2manage create -t web.json -n beta
43
+
44
+ If ec2manage can't find the specified path in the current directory it will attempt to load the file from `~/.ec2manage/web.json`. In this case you could also omit the extension and just use `-t web`.
45
+
46
+ Additionally, if you omit all configuration options, ec2manage will try to load `~/.ec2manage/default.json`.
47
+
48
+ Create a new ec2 instance and ssh into it:
49
+
50
+ > ec2manage create -c "ssh %"
51
+
52
+ The external hostname of the instance is passed to the command string using `String#%`. See [Kernel.sprintf](http://ruby-doc.org/core/classes/Kernel.html#M005962) for details on how this function works.
53
+
54
+ Naming machines
55
+ ---------------
56
+
57
+ You can get a JSON list of all images and volumes by running ec2manage with no arguments:
58
+
59
+ > ec2manage
60
+
61
+ You can also give your instances new nicknames using the rename command:
62
+
63
+ > ec2manage rename i-12345 staging
64
+
65
+ Deleting machines
66
+ -----------------
67
+
68
+ And finally you can remove machines as well as their associated volumes by using the delete command with the `-v` flag:
69
+
70
+ > ec2manage delete staging -v
71
+
72
+ If you have an unassociated volume you can delete it by name as well:
73
+
74
+ > ec2manage delete v-12345
data/bin/ec2manage ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ begin
4
+ require 'ec2manage'
5
+ rescue LoadError
6
+ require 'rubygems'
7
+ require 'ec2manage'
8
+ end
9
+
10
+ EC2Manage::Commands.start
data/lib/ec2manage.rb ADDED
@@ -0,0 +1,7 @@
1
+ module EC2Manage
2
+ class Commands
3
+ def self.start
4
+ puts "hello world"
5
+ end
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,123 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ec2manage
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Mat Schaffer
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-07-09 00:00:00 -04:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: thor
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 13
30
+ - 7
31
+ version: 0.13.7
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: json
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 1
43
+ - 4
44
+ - 3
45
+ version: 1.4.3
46
+ type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: right_aws
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 2
57
+ - 0
58
+ - 0
59
+ version: 2.0.0
60
+ type: :runtime
61
+ version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ name: rspec
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 0
71
+ version: "0"
72
+ type: :development
73
+ version_requirements: *id004
74
+ description: |
75
+ ec2manage is a command line tool for managing EC2 instances.
76
+
77
+ It's main goal is to provide the same style of control as the
78
+ Amazon EC2 API Tools but with additional structure and metadata
79
+ make administrative decisions easier.
80
+
81
+ email: mat@schaffer.me
82
+ executables:
83
+ - ec2manage
84
+ extensions: []
85
+
86
+ extra_rdoc_files: []
87
+
88
+ files:
89
+ - README.md
90
+ - bin/ec2manage
91
+ - lib/ec2manage.rb
92
+ has_rdoc: false
93
+ homepage: http://matschaffer.com
94
+ licenses: []
95
+
96
+ post_install_message:
97
+ rdoc_options: []
98
+
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ segments:
106
+ - 0
107
+ version: "0"
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ segments:
113
+ - 0
114
+ version: "0"
115
+ requirements: []
116
+
117
+ rubyforge_project: suppress_warnings
118
+ rubygems_version: 1.3.6
119
+ signing_key:
120
+ specification_version: 3
121
+ summary: A command-line manager for EC2 instances.
122
+ test_files: []
123
+