terrafying-components 1.15.25 → 1.15.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 065624fa7820b9041d5b8197c725d6d28b31e8d1a305e0ea5392ae5dc34249ea
4
- data.tar.gz: 65f410d981a749ec65c5108ac4b96a9abe58f30f193251f606f1d9a7baafe799
3
+ metadata.gz: b1bfe78aadfcc91a0c8aa5bbfca445707fad35f5957a9dd4b0a32c7d524c2505
4
+ data.tar.gz: e3fee09e5c6ec1e105ed3ece2eacfa34bd8f9f10040fcaa12f5c1e198c1e8db6
5
5
  SHA512:
6
- metadata.gz: 3f8a4922ae67518c2387aa118bcf4ad094677cb6dd7f91e4d862072ccd177fe46547388f258c53b32e1224d3c77960b7dd3a56f2376265c2227a280f7d8eb045
7
- data.tar.gz: f92cc6b8f795495c280b10f141e1c78a3c3b5b814c22ae9c4b02d85c9b82589dd4756f19e0017b10dc912a57d52ccd366c894b49076e695b17cd0717285e80c5
6
+ metadata.gz: d785a85a3767b9c6aed35de5eb0f15033ea323d55cf7e165cbf266a85103f6789f5ace3d5af18569dff0ff6d20c93e19ad1921aee4c26c061da3809cea1f154d
7
+ data.tar.gz: bb418b96219c5ac53c5635d644f99807c4a4b66d423c988a073e3c75f58797b6524b2c6473f5138cdb3faa20ea2623749b82c2b43fce5f8f657f2a16730b8b9d
@@ -44,9 +44,12 @@ module Terrafying
44
44
  subnets: vpc.subnets.fetch(:private, []),
45
45
  depends_on: [],
46
46
  rolling_update: :simple,
47
+ metadata_options: nil,
47
48
  vpc_endpoints_egress: []
48
49
  }.merge(options)
49
50
 
51
+ metadata_options = options[:metadata_options]
52
+
50
53
  ident = "#{tf_safe(vpc.name)}-#{name}"
51
54
 
52
55
  @name = ident
@@ -85,6 +88,7 @@ module Terrafying
85
88
  lifecycle: {
86
89
  create_before_destroy: true
87
90
  },
91
+ metadata_options: options[:metadata_options],
88
92
  depends_on: resource_name_from(options[:instance_profile])
89
93
 
90
94
  if options[:instances][:track]
@@ -36,6 +36,7 @@ module Terrafying
36
36
  instance_profile: nil,
37
37
  ports: [],
38
38
  tags: {},
39
+ metadata_options: nil,
39
40
  security_groups: [],
40
41
  depends_on: []
41
42
  }.merge(options)
@@ -55,7 +56,12 @@ module Terrafying
55
56
  from_port: 0,
56
57
  to_port: 0,
57
58
  protocol: -1,
58
- cidr_blocks: ['0.0.0.0/0']
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
59
65
  }
60
66
  ]
61
67
 
@@ -99,6 +105,7 @@ module Terrafying
99
105
  vpc.internal_ssh_security_group
100
106
  ].push(*options[:security_groups]),
101
107
  user_data: options[:user_data],
108
+ metadata_options: options[:metadata_options],
102
109
  lifecycle: {
103
110
  create_before_destroy: true
104
111
  },
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'digest'
3
+ require 'digest/bubblebabble'
4
4
  require 'terrafying/components/usable'
5
5
  require 'terrafying/generator'
6
-
6
+ require 'digest'
7
7
  require_relative './ports'
8
8
 
9
9
  module Terrafying
@@ -216,9 +216,14 @@ 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
221
219
 
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
+
222
227
  gen_id[0..31]
223
228
  end
224
229
  end
@@ -22,7 +22,7 @@ module Terrafying
22
22
  thanos_name: 'thanos',
23
23
  thanos_version: 'v0.10.1',
24
24
  prom_name: 'prometheus',
25
- prom_version: 'v2.15.2',
25
+ prom_version: 'v2.23.0',
26
26
  instances: 2,
27
27
  instance_type: 't3a.small',
28
28
  thanos_instance_type: 't3a.small',
@@ -59,6 +59,7 @@ module Terrafying
59
59
  subnets: vpc.subnets.fetch(:private, []),
60
60
  startup_grace_period: 300,
61
61
  depends_on: [],
62
+ metadata_options: nil,
62
63
  audit_role: "arn:aws:iam::#{aws.account_id}:role/auditd_logging",
63
64
  metrics_ports: [],
64
65
  vpc_endpoints_egress: []
@@ -96,6 +97,8 @@ module Terrafying
96
97
  @instance_profile = add! InstanceProfile.create(ident, statements: iam_statements)
97
98
  end
98
99
 
100
+ metadata_options = options[:metadata_options]
101
+
99
102
  tags = options[:tags].merge(service_name: name)
100
103
 
101
104
  set = options[:instances].is_a?(Hash) ? DynamicSet : StaticSet
@@ -112,6 +115,7 @@ module Terrafying
112
115
  instance_set_options = {
113
116
  instance_profile: @instance_profile,
114
117
  depends_on: depends_on,
118
+ metadata_options: metadata_options,
115
119
  tags: tags
116
120
  }
117
121
 
@@ -38,7 +38,7 @@ module Terrafying
38
38
  options = {
39
39
  public: false,
40
40
  eip: false,
41
- ami: aws.ami('base-image-fc-2860fb52', owners = ['136393635417']),
41
+ ami: aws.ami('base-image-fc-3c48f829', owners = ['477284023816']),
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.25'
5
+ VERSION = '1.15.26'
6
6
  end
7
7
  end
@@ -5,6 +5,7 @@ require 'netaddr'
5
5
  require 'terrafying/components/subnet'
6
6
  require 'terrafying/components/zone'
7
7
  require 'terrafying/generator'
8
+ require 'digest/bubblebabble'
8
9
 
9
10
  module Terrafying
10
11
  module Components
@@ -184,7 +185,12 @@ module Terrafying
184
185
  from_port: 22,
185
186
  to_port: 22,
186
187
  protocol: 'tcp',
187
- cidr_blocks: [@cidr]
188
+ cidr_blocks: [@cidr],
189
+ description: nil,
190
+ ipv6_cidr_blocks: nil,
191
+ prefix_list_ids: nil,
192
+ security_groups: nil,
193
+ self: nil
188
194
  }
189
195
  ],
190
196
  egress: [
@@ -192,7 +198,12 @@ module Terrafying
192
198
  from_port: 22,
193
199
  to_port: 22,
194
200
  protocol: 'tcp',
195
- cidr_blocks: [@cidr]
201
+ cidr_blocks: [@cidr],
202
+ description: nil,
203
+ ipv6_cidr_blocks: nil,
204
+ prefix_list_ids: nil,
205
+ security_groups: nil,
206
+ self: nil
196
207
  }
197
208
  ]
198
209
  self
@@ -233,7 +244,7 @@ module Terrafying
233
244
  subnets: @subnets.values.flatten
234
245
  }.merge(options)
235
246
 
236
- ident = tf_safe(ip_address)
247
+ ident = tf_safe(Digest::SHA256.bubblebabble(ip_address)[0..11]+ip_address)
237
248
 
238
249
  if options[:tunnels].count > 2
239
250
  raise 'You can only define a max of two tunnels'
@@ -283,7 +294,7 @@ module Terrafying
283
294
  route_tables.product(cidrs).each do |route_table, cidr|
284
295
  hash = Digest::SHA2.hexdigest "#{route_table}-#{tf_safe(cidr)}"
285
296
 
286
- resource :aws_route, "#{@name}-to-#{ident}-peer-#{hash}",
297
+ resource :aws_route, "#{@name}-to-#{tf_safe(ip_address)}-peer-#{hash}",
287
298
  route_table_id: route_table,
288
299
  destination_cidr_block: cidr,
289
300
  gateway_id: vpn_gateway
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terrafying-components
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.25
4
+ version: 1.15.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - uSwitch Limited
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-29 00:00:00.000000000 Z
11
+ date: 2020-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake