terrafying-components 1.10.4 → 1.10.5

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: f4d8b9785657811b48df047fad206a2b15f17a0d3e4296f3413f9a7560ed7681
4
- data.tar.gz: 4d75ed2b269539e71f24d07092f74c59f3269c96a83f73a3b95966b34ac97c1d
3
+ metadata.gz: ec33549375f3c5a5358b324537c19e1f0ea2216d0daa9ec4e2c4b03a321a6eea
4
+ data.tar.gz: 64ef01c017e9389fce36879e1ab1193ed25ee2badb36ce5b82c9a48c149ae682
5
5
  SHA512:
6
- metadata.gz: 90a302fbff6a53f35b361612d08726889a689de593140d5c03164241a213e20e9a6273f50b8764d075579b03300d00a095bdc0a02823e372b1c16d0868ecbb25
7
- data.tar.gz: 88d6e40c41f3b8fd302eae5910bd1a9dc4adfe01e1e3c9650a3b3e8078ddbb89d95b2fd5731d8249782f13522101b79b3d43cc2cd623ece6b0dcd19c754f2161
6
+ metadata.gz: 14210c35fb732bd58c155369a4158bce8ebf13a7746071d5ca551fdb1f27060a7439ca7a8a44793875cd08e176ac7de3120a7520966b8c820692dd08d8f28dcb
7
+ data.tar.gz: f091c0aca5fefa02b2d3058a42ca017027d9b95a5d2382332e17a8198cfcd07fd4389a090e91cd3c71fb76004582e434fa5109a5d113200b5e742b3bb0ef1be1
@@ -53,19 +53,13 @@ module Terrafying
53
53
  @ports = enrich_ports(options[:ports])
54
54
 
55
55
  @security_group = resource :aws_security_group, ident, {
56
- name: "dynamicset-#{ident}",
57
- description: "Describe the ingress and egress of the service #{ident}",
58
- tags: options[:tags],
59
- vpc_id: vpc.id,
60
- egress: [
61
- {
62
- from_port: 0,
63
- to_port: 0,
64
- protocol: -1,
65
- cidr_blocks: ["0.0.0.0/0"],
66
- }
67
- ],
68
- }
56
+ name: "dynamicset-#{ident}",
57
+ description: "Describe the ingress and egress of the service #{ident}",
58
+ tags: options[:tags],
59
+ vpc_id: vpc.id
60
+ }
61
+
62
+ default_egress_rule(ident, @security_group)
69
63
 
70
64
  path_mtu_setup!
71
65
 
@@ -123,6 +117,18 @@ module Terrafying
123
117
  self
124
118
  end
125
119
 
120
+
121
+ def default_egress_rule(ident, security_group)
122
+ resource :aws_security_group_rule, "#{ident}-default-egress", {
123
+ security_group_id: security_group,
124
+ type: 'egress',
125
+ from_port: 0,
126
+ to_port: 0,
127
+ protocol: -1,
128
+ cidr_blocks: ['0.0.0.0/0'],
129
+ }
130
+ end
131
+
126
132
  def profile_from(profile)
127
133
  profile.respond_to?(:id) ? profile.id : profile
128
134
  end
@@ -59,19 +59,13 @@ module Terrafying
59
59
  @ports = enrich_ports(options[:ports])
60
60
 
61
61
  @security_group = resource :aws_security_group, ident, {
62
- name: "staticset-#{ident}",
63
- description: "Describe the ingress and egress of the static set #{ident}",
64
- tags: options[:tags],
65
- vpc_id: vpc.id,
66
- egress: [
67
- {
68
- from_port: 0,
69
- to_port: 0,
70
- protocol: -1,
71
- cidr_blocks: ["0.0.0.0/0"],
72
- }
73
- ],
74
- }
62
+ name: "staticset-#{ident}",
63
+ description: "Describe the ingress and egress of the static set #{ident}",
64
+ tags: options[:tags],
65
+ vpc_id: vpc.id,
66
+ }
67
+
68
+ default_egress_rule(ident, @security_group)
75
69
 
76
70
  path_mtu_setup!
77
71
 
@@ -113,6 +107,17 @@ module Terrafying
113
107
  self
114
108
  end
115
109
 
110
+ def default_egress_rule(ident, security_group)
111
+ resource :aws_security_group_rule, "#{ident}-default-egress", {
112
+ security_group_id: security_group,
113
+ type: 'egress',
114
+ from_port: 0,
115
+ to_port: 0,
116
+ protocol: -1,
117
+ cidr_blocks: ['0.0.0.0/0'],
118
+ }
119
+ end
120
+
116
121
  def volume_for(name, instance, volume, tags)
117
122
  vol_opts = {
118
123
  availability_zone: instance.subnet.az,
@@ -1,5 +1,5 @@
1
1
  module Terrafying
2
2
  module Components
3
- VERSION = "1.10.4"
3
+ VERSION = "1.10.5"
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.10.4
4
+ version: 1.10.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - uSwitch Limited