soror 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -9
- data/bin/soror +7 -3
- data/lib/soror/version.rb +1 -1
- data/lib/soror.rb +4 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e3d60cc5af136386d68b720f81b4646daa38bcb
|
4
|
+
data.tar.gz: c6f95bb345ce5ed90d7374b0e22929c8209b9ee0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03c0040dc4ebf8460ff34c0b1ff397bf3ccd3a52f2ceb040cd662dddbad8fa8893bb6df3aed02d8a7b79ee82023d3cb2d71ea4a7a043e1355e15223d6091513f
|
7
|
+
data.tar.gz: ccdb481f89052bd992d7a4786ed9a8b4d9c3a8ceebd5bf2af3224c43e4717f4a9bd0f94c86620b65c305b85ef36040cfa23e5e57bf027d2ac43f256437372b8d
|
data/README.md
CHANGED
@@ -33,15 +33,7 @@ Soror::EC2::Instance.search_by(name: 'soror') #=> [<Aws::EC2::Instance>, ...]
|
|
33
33
|
Soror.config.update(access_key_id: 'xxxxx', secret_access_key: 'xxxxx', region: 'ap-northeast-1')
|
34
34
|
```
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
```sh
|
39
|
-
$ cat <<EOS >$HOME/.soror
|
40
|
-
access_key_id: 'xxxxx'
|
41
|
-
secret_access_key: 'xxxxx'
|
42
|
-
region: 'ap-northeast-1'
|
43
|
-
EOS
|
44
|
-
```
|
36
|
+
In addition, Soror supports [a new and standardized way to manage credentials](http://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs)
|
45
37
|
|
46
38
|
## CLI
|
47
39
|
|
@@ -51,9 +43,16 @@ Usage: soror [options]
|
|
51
43
|
-t, --tag='KEY=VALUE'
|
52
44
|
-a, --attributes=ATTR,ATTR,...
|
53
45
|
--[no-]header
|
46
|
+
--profile-name=NAME
|
47
|
+
--credentials-path=PATH
|
54
48
|
--access-key=KEY
|
55
49
|
--secret-key=KEY
|
56
50
|
--region=REGION
|
51
|
+
|
52
|
+
$ soror --profile-name 'kirikiriyamama' --region 'ap-northeast-1' --tag 'name=soror' --attributes 'instance_id,public_ip_address'
|
53
|
+
instance_id public_ip_address
|
54
|
+
i-xxxxx xxx.xxx.xxx.xxx
|
55
|
+
i-xxxxx xxx.xxx.xxx.xxx
|
57
56
|
```
|
58
57
|
|
59
58
|
## Required permissions
|
data/bin/soror
CHANGED
@@ -5,23 +5,27 @@ require 'soror'
|
|
5
5
|
|
6
6
|
Version = Soror::VERSION
|
7
7
|
|
8
|
-
options = { header: true,
|
8
|
+
options = { header: true, attributes: [], config: {}, credentials: {}, tag: {} }
|
9
9
|
OptionParser.new do |opt|
|
10
10
|
opt.on('-t', '--tag=\'KEY=VALUE\'', /\A[^=]+=[^=]+\z/) do |v|
|
11
11
|
key, val = v.split('=')
|
12
12
|
options[:tag][key] = val
|
13
13
|
end
|
14
|
-
opt.on('-a', '--attributes=ATTR,ATTR,...', Array) { |
|
14
|
+
opt.on('-a', '--attributes=ATTR,ATTR,...', Array) { |a| options[:attributes] = a }
|
15
15
|
opt.on('--[no-]header') { |v| options[:header] = v }
|
16
|
+
opt.on('--profile-name=NAME') { |v| options[:credentials][:profile_name] = v }
|
17
|
+
opt.on('--credentials-path=PATH') { |v| options[:credentials][:path] = v }
|
16
18
|
opt.on('--access-key=KEY') { |v| options[:config][:access_key_id] = v }
|
17
19
|
opt.on('--secret-key=KEY') { |v| options[:config][:secret_access_key] = v }
|
18
20
|
opt.on('--region=REGION') { |v| options[:config][:region] = v }
|
19
21
|
opt.parse!(ARGV)
|
20
22
|
end
|
21
23
|
fail OptionParser::MissingArgument, '--tag' if options[:tag].empty?
|
22
|
-
fail OptionParser::MissingArgument, '--attributes' if options[:attributes].nil?
|
23
24
|
fail OptionParser::InvalidArgument, '--attributes' if options[:attributes].empty?
|
24
25
|
|
26
|
+
unless options[:credentials].empty?
|
27
|
+
options[:config][:credentials] = Aws::SharedCredentials.new(options[:credentials])
|
28
|
+
end
|
25
29
|
Soror.config.update(options[:config])
|
26
30
|
|
27
31
|
instances = Soror::EC2::Instance.search_by(options[:tag])
|
data/lib/soror/version.rb
CHANGED
data/lib/soror.rb
CHANGED
@@ -28,5 +28,8 @@ module Soror
|
|
28
28
|
end
|
29
29
|
|
30
30
|
File.expand_path('~/.soror').tap do |path|
|
31
|
-
|
31
|
+
if File.exists?(path)
|
32
|
+
warn '[DEPRECATION] Support of `~/.soror` will be removed. Please use such as `~/.aws/credentials` instead.'
|
33
|
+
Soror.config.update(YAML.load_file(path).symbolize_keys)
|
34
|
+
end
|
32
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soror
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kirikiriyamama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
93
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.
|
94
|
+
rubygems_version: 2.4.5
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Search for EC2 instances by tags
|