terrafying 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/terrafying/aws.rb +33 -0
- data/lib/terrafying/generator.rb +4 -0
- data/lib/terrafying/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79b501b5f9ac84fab8591bdacd4cc5c30e4810b5
|
4
|
+
data.tar.gz: dbbac5466269c2e01a853c3d92c7e09d05378d43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b00037a9778771192addfab9afd6655ad777c3f12006290ea292a393ba3f7f37db58b023da6550345973b2a18ba57a673e1b6f1ffc8e0cce44863e17af0c0ac
|
7
|
+
data.tar.gz: 68e0a28098c4e66369a8ef491ecd44cbe82413b3ff98364335d939240a77a01e6e285d4248d50e955c4b7a23925783616a605509cc48162da2f949c2f3f01008
|
data/lib/terrafying/aws.rb
CHANGED
@@ -56,6 +56,35 @@ module Terrafying
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
+
def security_group_in_vpc(vpc_id, name)
|
60
|
+
@security_groups_in_vpc ||= {}
|
61
|
+
@security_groups_in_vpc[vpc_id + name] ||=
|
62
|
+
begin
|
63
|
+
STDERR.puts "Looking up id of security group '#{name}'"
|
64
|
+
groups = @ec2_resource.security_groups(
|
65
|
+
{
|
66
|
+
filters: [
|
67
|
+
{
|
68
|
+
name: "group-name",
|
69
|
+
values: [name],
|
70
|
+
},
|
71
|
+
{
|
72
|
+
name: "vpc-id",
|
73
|
+
values: [vpc_id],
|
74
|
+
}
|
75
|
+
],
|
76
|
+
}).limit(2)
|
77
|
+
case
|
78
|
+
when groups.count == 1
|
79
|
+
groups.first.id
|
80
|
+
when groups.count < 1
|
81
|
+
raise "No security group with name '#{name}' was found."
|
82
|
+
when groups.count > 1
|
83
|
+
raise "More than one security group with name '#{name}' found: " + groups.join(', ')
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
59
88
|
def security_group_by_tags(tags)
|
60
89
|
@security_groups_by_tags ||= {}
|
61
90
|
@security_groups_by_tags[tags] ||=
|
@@ -161,6 +190,10 @@ module Terrafying
|
|
161
190
|
names.map{|n| security_group(n)}
|
162
191
|
end
|
163
192
|
|
193
|
+
def security_groups_in_vpc(vpc_id, *names)
|
194
|
+
names.map{|n| security_group_in_vpc(vpc_id, n)}
|
195
|
+
end
|
196
|
+
|
164
197
|
def subnet(name)
|
165
198
|
@subnets ||= {}
|
166
199
|
@subnets[name] ||=
|
data/lib/terrafying/generator.rb
CHANGED
data/lib/terrafying/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terrafying
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- uSwitch Limited
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|