aws-graph 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-graph/version.rb +1 -1
- data/lib/aws-graph.rb +29 -7
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e149eefa7e2a3cb4e32686669a74e5d53a6a1323
|
4
|
+
data.tar.gz: 1f4d5efd58427441d0e87bd52cd847663e97ef4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 198e3f0b5fa42871d854579d760f92963186a55c82df3e27de44d954f7e41edc12c86fe57d0c814fa049e63b4c59d12dd49995bc5dd2bc274463fd5a17f35099
|
7
|
+
data.tar.gz: 87ec6363dd2287af306c8524a61271cc01007d31d3cc09c98e13a1f1536ea5af493468b032844cd046381f9a8a023a10caf4a4faa68089cff13cb1cf9c093c08
|
data/lib/aws-graph/version.rb
CHANGED
data/lib/aws-graph.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
require "aws-graph/version"
|
2
3
|
require "thor"
|
3
4
|
require 'aws-sdk'
|
@@ -39,11 +40,23 @@ module AwsGraph
|
|
39
40
|
|
40
41
|
# Create EC2 security group cluster
|
41
42
|
security_groups.each do | sg |
|
42
|
-
print "."
|
43
43
|
cluster_id = 'cluster' + sg.id.gsub(/[-\/]/,'')
|
44
44
|
sg_hash[sg.id] = cluster_id
|
45
|
+
|
46
|
+
if sg.vpc_id
|
47
|
+
print "v"
|
48
|
+
color = '#4B75B9'
|
49
|
+
label = Util.new.label(sg.name + '[' + sg.id + ']', secret) + '[vpc]'
|
50
|
+
style = 'rounded,bold'
|
51
|
+
else
|
52
|
+
print "."
|
53
|
+
color = '#333333'
|
54
|
+
label = Util.new.label(sg.name + '[' + sg.id + ']', secret)
|
55
|
+
style = 'rounded,bold'
|
56
|
+
end
|
57
|
+
|
45
58
|
subgraph(cluster_id.to_sym) do
|
46
|
-
global label:
|
59
|
+
global label: label, style: style, color: color
|
47
60
|
end
|
48
61
|
end
|
49
62
|
|
@@ -51,8 +64,19 @@ module AwsGraph
|
|
51
64
|
db_security_groups[:db_security_groups].each do | db_sg |
|
52
65
|
print "."
|
53
66
|
cluster_id = 'cluster' + db_sg[:db_security_group_name].gsub(/[-\/]/,'')
|
67
|
+
if db_sg[:vpc_id]
|
68
|
+
print "v"
|
69
|
+
color = '#4B75B9'
|
70
|
+
label = Util.new.label(db_sg[:db_security_group_name], secret) + '[vpc]'
|
71
|
+
style = 'rounded,bold'
|
72
|
+
else
|
73
|
+
print "."
|
74
|
+
color = '#333333'
|
75
|
+
label = Util.new.label(db_sg[:db_security_group_name], secret)
|
76
|
+
style = 'rounded,bold'
|
77
|
+
end
|
54
78
|
subgraph(cluster_id.to_sym) do
|
55
|
-
global label:
|
79
|
+
global label: label, style: style, color: color
|
56
80
|
end
|
57
81
|
end
|
58
82
|
|
@@ -67,7 +91,7 @@ module AwsGraph
|
|
67
91
|
print "."
|
68
92
|
cluster_id = 'cluster' + sg.id.gsub(/[-\/]/,'')
|
69
93
|
subgraph(cluster_id.to_sym) do
|
70
|
-
node (sg.id +
|
94
|
+
node (sg.id + e.id).gsub(/[-\/]/, '').to_sym, label: Util.new.label(e.id, secret), shape: :none, image: image_path
|
71
95
|
end
|
72
96
|
end
|
73
97
|
end
|
@@ -84,14 +108,13 @@ module AwsGraph
|
|
84
108
|
print "v"
|
85
109
|
cluster_id = 'cluster' + sg.id.gsub(/[-\/]/,'')
|
86
110
|
subgraph(cluster_id.to_sym) do
|
87
|
-
node (sg.id +
|
111
|
+
node (sg.id + e.id).gsub(/[-\/]/, '').to_sym, label: Util.new.label(e.id, secret), shape: :none, image: image_path
|
88
112
|
end
|
89
113
|
end
|
90
114
|
end
|
91
115
|
end
|
92
116
|
|
93
117
|
# Append RDS to RDS security group
|
94
|
-
db_instancesa = {}
|
95
118
|
db_instances[:db_instances].each do | r |
|
96
119
|
r[:db_security_groups].each do | db_sg |
|
97
120
|
print "."
|
@@ -122,7 +145,6 @@ module AwsGraph
|
|
122
145
|
print "-"
|
123
146
|
unless sg_hash[fromsg.id]
|
124
147
|
# Unknown security group is amazon-elb/amazon-elb-sg
|
125
|
-
unknown = AWS::EC2::SecurityGroup.new(fromsg.id)
|
126
148
|
cluster_id = 'cluster' + fromsg.id.gsub(/[-\/]/,'')
|
127
149
|
sg_hash['amazon-elb/amazon-elb-sg'] = cluster_id
|
128
150
|
subgraph(cluster_id.to_sym) do
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02
|
11
|
+
date: 2014-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.5'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: aws-sdk
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: thor
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: gviz
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
description: Draw AWS security based network graph with Graphviz
|
@@ -88,7 +88,7 @@ executables:
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
-
- .gitignore
|
91
|
+
- ".gitignore"
|
92
92
|
- Gemfile
|
93
93
|
- README.md
|
94
94
|
- Rakefile
|
@@ -111,17 +111,17 @@ require_paths:
|
|
111
111
|
- lib
|
112
112
|
required_ruby_version: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
-
- -
|
114
|
+
- - ">="
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
118
|
requirements:
|
119
|
-
- -
|
119
|
+
- - ">="
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.0
|
124
|
+
rubygems_version: 2.2.0
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: Draw AWS network graph with Graphviz
|