terrafying-components 1.6.6 → 1.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b74fe68cc239c4a9756368289e815faeb2ad375f141ddda11aa2feb951e6270
4
- data.tar.gz: c73a1b6fb5c1f64a4b2fdec591891f1905bb16340bf5f8ffe1d1d808dc88315c
3
+ metadata.gz: faec475d282b6b0d64b4233889f861aab40a64a37a746d9dbe9433b3f76899b3
4
+ data.tar.gz: e2e7bc41156404be15c4a542cbe9b86ad98c26193a8c08386a073357ca4385e2
5
5
  SHA512:
6
- metadata.gz: a8ec2ca25f451aba09b51cf57bca6d1b2d68d40a70fb3ee42c8d6b21036c087b951979657e92adc311ea73942bffd4a3df11fb20bad8c29888f470140a6bc88a
7
- data.tar.gz: ca48d7c54a32168ed490d8f5fc270d6930c1db8104b0b80c7205946d20dc1e7d5464f48368f7f230328345bd39153cb1e4fb6578e68c5af1715b99f9c75877fa
6
+ metadata.gz: f9f286c6a05b7b72827f8cf50f4391e4b6ac373566baf3fe597ea5390973fff7d770f35ba4b8d25d07afc717ab003e159d1cd0249718d7f5059b0eeb04f2fbf1
7
+ data.tar.gz: 2314cda2677a34077ec0daf094b9b73f681374ed5bfc61d4dc783a21be3ef9de476aff6ca423b81bd6c2bed84d5a300b22b8b58d9b21f5879a8e1f82c549c408
@@ -41,18 +41,18 @@ module Terrafying
41
41
  }
42
42
  end
43
43
 
44
- def used_by_cidr(*cidrs)
44
+ def used_by_cidr(*cidrs, &block)
45
45
  cidrs.map { |cidr|
46
- cidr_ident = cidr.gsub(/[\.\/]/, "-")
46
+ cidr_ident = cidr.tr('./', '-')
47
47
 
48
- @ports.map {|port|
48
+ @ports.select(&block).map { |port|
49
49
  resource :aws_security_group_rule, "#{@name}-to-#{cidr_ident}-#{port[:name]}", {
50
- security_group_id: self.ingress_security_group,
50
+ security_group_id: ingress_security_group,
51
51
  type: "ingress",
52
52
  from_port: from_port(port[:upstream_port]),
53
53
  to_port: to_port(port[:upstream_port]),
54
54
  protocol: port[:type] == "udp" ? "udp" : "tcp",
55
- cidr_blocks: [cidr],
55
+ cidr_blocks: [cidr]
56
56
  }
57
57
  }
58
58
  }
@@ -98,9 +98,9 @@ module Terrafying
98
98
  }
99
99
  end
100
100
 
101
- def used_by(*other_resources)
101
+ def used_by(*other_resources, &block)
102
102
  other_resources.map { |other_resource|
103
- @ports.map {|port|
103
+ @ports.select(&block).map.map {|port|
104
104
  resource :aws_security_group_rule, "#{@name}-to-#{other_resource.name}-#{port[:name]}", {
105
105
  security_group_id: self.ingress_security_group,
106
106
  type: "ingress",
@@ -1,5 +1,5 @@
1
1
  module Terrafying
2
2
  module Components
3
- VERSION = "1.6.6"
3
+ VERSION = "1.6.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terrafying-components
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.6
4
+ version: 1.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - uSwitch Limited