terrafying-components 1.15.23 → 1.15.25

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: 38c0abb6c26db58962498dbf9d7972f882961b3eea7ae15ea9e751006a20a8ec
4
- data.tar.gz: eb67dc1708c7ea17c0ad765f497f880355f34ef66f24b6065db42a5508a400ad
3
+ metadata.gz: 065624fa7820b9041d5b8197c725d6d28b31e8d1a305e0ea5392ae5dc34249ea
4
+ data.tar.gz: 65f410d981a749ec65c5108ac4b96a9abe58f30f193251f606f1d9a7baafe799
5
5
  SHA512:
6
- metadata.gz: 68441af54da4b7245890c814210046a19907b359a2001f44213db873a1eea9c0081aa2b04371545887765c5859bd241edf2488d8b3c5b1222e81e91c05ef263c
7
- data.tar.gz: 7e864776191dda38e812051ce5c2ee74cce3ae8a6de474698b57057ea77328c611475706c3619e14c5b522037b0b8615d94520fe0f6616ff864d2bd1d3ec3b9c
6
+ metadata.gz: 3f8a4922ae67518c2387aa118bcf4ad094677cb6dd7f91e4d862072ccd177fe46547388f258c53b32e1224d3c77960b7dd3a56f2376265c2227a280f7d8eb045
7
+ data.tar.gz: f92cc6b8f795495c280b10f141e1c78a3c3b5b814c22ae9c4b02d85c9b82589dd4756f19e0017b10dc912a57d52ccd366c894b49076e695b17cd0717285e80c5
@@ -44,12 +44,9 @@ module Terrafying
44
44
  subnets: vpc.subnets.fetch(:private, []),
45
45
  depends_on: [],
46
46
  rolling_update: :simple,
47
- metadata_options: nil,
48
47
  vpc_endpoints_egress: []
49
48
  }.merge(options)
50
49
 
51
- metadata_options = options[:metadata_options]
52
-
53
50
  ident = "#{tf_safe(vpc.name)}-#{name}"
54
51
 
55
52
  @name = ident
@@ -88,7 +85,6 @@ module Terrafying
88
85
  lifecycle: {
89
86
  create_before_destroy: true
90
87
  },
91
- metadata_options: options[:metadata_options],
92
88
  depends_on: resource_name_from(options[:instance_profile])
93
89
 
94
90
  if options[:instances][:track]
@@ -36,7 +36,6 @@ module Terrafying
36
36
  instance_profile: nil,
37
37
  ports: [],
38
38
  tags: {},
39
- metadata_options: nil,
40
39
  security_groups: [],
41
40
  depends_on: []
42
41
  }.merge(options)
@@ -56,12 +55,7 @@ module Terrafying
56
55
  from_port: 0,
57
56
  to_port: 0,
58
57
  protocol: -1,
59
- cidr_blocks: ['0.0.0.0/0'],
60
- ipv6_cidr_blocks: nil,
61
- prefix_list_ids: nil,
62
- security_groups: nil,
63
- self: nil,
64
- description: nil
58
+ cidr_blocks: ['0.0.0.0/0']
65
59
  }
66
60
  ]
67
61
 
@@ -105,7 +99,6 @@ module Terrafying
105
99
  vpc.internal_ssh_security_group
106
100
  ].push(*options[:security_groups]),
107
101
  user_data: options[:user_data],
108
- metadata_options: options[:metadata_options],
109
102
  lifecycle: {
110
103
  create_before_destroy: true
111
104
  },
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'digest/bubblebabble'
3
+ require 'digest'
4
4
  require 'terrafying/components/usable'
5
5
  require 'terrafying/generator'
6
- require 'digest'
6
+
7
7
  require_relative './ports'
8
8
 
9
9
  module Terrafying
@@ -216,14 +216,9 @@ module Terrafying
216
216
  end
217
217
 
218
218
  def make_identifier(type, vpc_name, name)
219
+ gen_id = "#{type}-#{tf_safe(vpc_name)}-#{name}"
220
+ return Digest::SHA2.hexdigest(gen_id)[0..24] if @hex_ident || gen_id.size > 26
219
221
 
220
- gen_id = "#{type}-#{vpc_name}-#{name}"
221
- hex = Digest::SHA2.hexdigest(gen_id)[0..24]
222
- if hex[0..0] =~ /[a-z]/
223
- return hex if @hex_ident || gen_id.size > 26
224
- else return Digest::SHA256.bubblebabble(gen_id)[0..15]
225
- end
226
-
227
222
  gen_id[0..31]
228
223
  end
229
224
  end
@@ -59,7 +59,6 @@ module Terrafying
59
59
  subnets: vpc.subnets.fetch(:private, []),
60
60
  startup_grace_period: 300,
61
61
  depends_on: [],
62
- metadata_options: nil,
63
62
  audit_role: "arn:aws:iam::#{aws.account_id}:role/auditd_logging",
64
63
  metrics_ports: [],
65
64
  vpc_endpoints_egress: []
@@ -97,8 +96,6 @@ module Terrafying
97
96
  @instance_profile = add! InstanceProfile.create(ident, statements: iam_statements)
98
97
  end
99
98
 
100
- metadata_options = options[:metadata_options]
101
-
102
99
  tags = options[:tags].merge(service_name: name)
103
100
 
104
101
  set = options[:instances].is_a?(Hash) ? DynamicSet : StaticSet
@@ -115,7 +112,6 @@ module Terrafying
115
112
  instance_set_options = {
116
113
  instance_profile: @instance_profile,
117
114
  depends_on: depends_on,
118
- metadata_options: metadata_options,
119
115
  tags: tags
120
116
  }
121
117
 
@@ -38,7 +38,7 @@ module Terrafying
38
38
  options = {
39
39
  public: false,
40
40
  eip: false,
41
- ami: aws.ami('base-image-fc-3c48f829', owners = ['477284023816']),
41
+ ami: aws.ami('base-image-fc-2860fb52', owners = ['136393635417']),
42
42
  instance_type: 't3a.micro',
43
43
  subnets: vpc.subnets.fetch(:private, []),
44
44
  ports: [],
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Terrafying
4
4
  module Components
5
- VERSION = '1.15.23'
5
+ VERSION = '1.15.25'
6
6
  end
7
7
  end
@@ -5,7 +5,6 @@ require 'netaddr'
5
5
  require 'terrafying/components/subnet'
6
6
  require 'terrafying/components/zone'
7
7
  require 'terrafying/generator'
8
- require 'digest/bubblebabble'
9
8
 
10
9
  module Terrafying
11
10
  module Components
@@ -185,12 +184,7 @@ module Terrafying
185
184
  from_port: 22,
186
185
  to_port: 22,
187
186
  protocol: 'tcp',
188
- cidr_blocks: [@cidr],
189
- description: nil,
190
- ipv6_cidr_blocks: nil,
191
- prefix_list_ids: nil,
192
- security_groups: nil,
193
- self: nil
187
+ cidr_blocks: [@cidr]
194
188
  }
195
189
  ],
196
190
  egress: [
@@ -198,12 +192,7 @@ module Terrafying
198
192
  from_port: 22,
199
193
  to_port: 22,
200
194
  protocol: 'tcp',
201
- cidr_blocks: [@cidr],
202
- description: nil,
203
- ipv6_cidr_blocks: nil,
204
- prefix_list_ids: nil,
205
- security_groups: nil,
206
- self: nil
195
+ cidr_blocks: [@cidr]
207
196
  }
208
197
  ]
209
198
  self
@@ -244,7 +233,7 @@ module Terrafying
244
233
  subnets: @subnets.values.flatten
245
234
  }.merge(options)
246
235
 
247
- ident = tf_safe(Digest::SHA256.bubblebabble(ip_address)[0..11]+ip_address)
236
+ ident = tf_safe(ip_address)
248
237
 
249
238
  if options[:tunnels].count > 2
250
239
  raise 'You can only define a max of two tunnels'
@@ -294,7 +283,7 @@ module Terrafying
294
283
  route_tables.product(cidrs).each do |route_table, cidr|
295
284
  hash = Digest::SHA2.hexdigest "#{route_table}-#{tf_safe(cidr)}"
296
285
 
297
- resource :aws_route, "#{@name}-to-#{tf_safe(ip_address)}-peer-#{hash}",
286
+ resource :aws_route, "#{@name}-to-#{ident}-peer-#{hash}",
298
287
  route_table_id: route_table,
299
288
  destination_cidr_block: cidr,
300
289
  gateway_id: vpn_gateway
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.15.23
4
+ version: 1.15.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - uSwitch Limited