terrafying-components 2.0.1 → 2.0.6

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: 0ed9e1ca845d8806f8a66b55a0c24b7659d75f9927fb8963bce56565c5d324ef
4
- data.tar.gz: '09e2d9661b9a2041a62ca36bb3251962eef12af484499fe6a0cea649a7d83c26'
3
+ metadata.gz: 381091960226ad013643c23ecf9ffe470f97e7e963a3da0963d7b9c6d544823a
4
+ data.tar.gz: 98d43798fdfda73ed4c53b7c98d7b810dbce670bf02d0ee02f2cf70a63d2d48f
5
5
  SHA512:
6
- metadata.gz: b3655d57e5bfcf6efe36a8cf2bc8b8b6bf384721435bf10f5beb457cdf3f344e7a3ae7ea244a81a24441e72a183cf472b5ef6dd274a7aa866e259f2cacd363e8
7
- data.tar.gz: a8b13ddd1d36a9d8d5b9fbcf99345fb3ac4093af16d4711664dae80772a2a8aa0623595d2950d7c4d9c0b8f1f358b5660843ad65cabf75dfa0d7ed0682df1827
6
+ metadata.gz: 5aa09410da8a3e78c1a6a0d049d581803a3095be56124339dbf91ab7ad5b4d31ad2f5dc2fe8fae25a64a8bd76beb98b997361c490e2b3026a74bce44c62664ed
7
+ data.tar.gz: d6e0d709aaaa48a20ba219e2b5d7fee17185b2d14440df3c1e4322f35bc5720e0ef5a075e7b38f129d9c100682038544cd6bb4e4903d9a4800377641bf32ead2
@@ -33,7 +33,7 @@ module Terrafying
33
33
  options = {
34
34
  public: false,
35
35
  eip: false,
36
- ami: aws.ami('base-image-fc-2860fb52', owners = ['136393635417']),
36
+ ami: aws.ami('base-image-fc-3c48f829', owners = ['477284023816']),
37
37
  instance_type: 't3a.micro',
38
38
  instances: { min: 1, max: 1, desired: 1, tags: {} },
39
39
  ports: [],
@@ -44,7 +44,7 @@ module Terrafying
44
44
  subnets: vpc.subnets.fetch(:private, []),
45
45
  depends_on: [],
46
46
  rolling_update: :simple,
47
- metadata_options: {},
47
+ metadata_options: nil,
48
48
  vpc_endpoints_egress: []
49
49
  }.merge(options)
50
50
 
@@ -36,14 +36,9 @@ module Terrafying
36
36
  instance_profile: nil,
37
37
  ports: [],
38
38
  tags: {},
39
- security_groups: nil,
40
39
  metadata_options: nil,
41
- depends_on: nil,
42
- ipv6_cidr_blocks: nil,
43
- prefix_list_ids: nil,
44
- security_groups: nil,
45
- self: nil,
46
- description: nil,
40
+ security_groups: [],
41
+ depends_on: []
47
42
  }.merge(options)
48
43
 
49
44
  ident = "#{tf_safe(vpc.name)}-#{name}"
@@ -62,11 +57,11 @@ module Terrafying
62
57
  to_port: 0,
63
58
  protocol: -1,
64
59
  cidr_blocks: ['0.0.0.0/0'],
65
- ipv6_cidr_blocks: options[:ipv6_cidr_blocks],
66
- prefix_list_ids: options[:prefix_list_ids],
67
- security_groups: options[:security_groups],
68
- self: options[:self],
69
- description: options[:description]
60
+ ipv6_cidr_blocks: nil,
61
+ prefix_list_ids: nil,
62
+ security_groups: nil,
63
+ self: nil,
64
+ description: nil
70
65
  }
71
66
  ]
72
67
 
@@ -3,7 +3,7 @@
3
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::SHA256.bubblebabble(gen_id)[0..15] 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',
@@ -42,7 +42,7 @@ module Terrafying
42
42
  provider: @provider,
43
43
  role: role["name"],
44
44
  policy_arn: "arn:aws:iam::aws:policy/service-role/AWSConfigRoleForOrganizations",
45
- }
45
+ }.compact
46
46
 
47
47
  source = {}
48
48
 
@@ -41,7 +41,7 @@ module Terrafying
41
41
 
42
42
  def create_in(vpc, name, options = {})
43
43
  options = {
44
- ami: aws.ami('base-image-fc-2860fb52', owners = ['136393635417']),
44
+ ami: aws.ami('base-image-fc-3c48f829', owners = ['477284023816']),
45
45
  instance_type: 't3a.micro',
46
46
  ports: [],
47
47
  instances: [{}],
@@ -59,7 +59,7 @@ module Terrafying
59
59
  subnets: vpc.subnets.fetch(:private, []),
60
60
  startup_grace_period: 300,
61
61
  depends_on: [],
62
- metadata_options: {},
62
+ metadata_options: nil,
63
63
  audit_role: "arn:aws:iam::#{aws.account_id}:role/auditd_logging",
64
64
  metrics_ports: [],
65
65
  vpc_endpoints_egress: []
@@ -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: [],
@@ -63,7 +63,7 @@ module Terrafying
63
63
  description: "Describe the ingress and egress of the static set #{ident}",
64
64
  tags: options[:tags],
65
65
  vpc_id: vpc.id
66
-
66
+
67
67
  vpc_endpoints_egress = options[:vpc_endpoints_egress]
68
68
  if vpc_endpoints_egress.empty?
69
69
  default_egress_rule(ident, @security_group)
@@ -102,7 +102,7 @@ module Terrafying
102
102
  type: 'ingress',
103
103
  from_port: from_port(port[:upstream_port]),
104
104
  to_port: to_port(port[:upstream_port]),
105
- protocol: port[:type],
105
+ protocol: port[:type] == 'udp' ? 'udp' : 'tcp',
106
106
  self: true
107
107
  end
108
108
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Terrafying
4
4
  module Components
5
- VERSION = '2.0.1'
5
+ VERSION = '2.0.6'
6
6
  end
7
7
  end
@@ -294,7 +294,7 @@ module Terrafying
294
294
  route_tables.product(cidrs).each do |route_table, cidr|
295
295
  hash = Digest::SHA2.hexdigest "#{route_table}-#{tf_safe(cidr)}"
296
296
 
297
- resource :aws_route, "#{@name}-to-#{ident}-peer-#{hash}",
297
+ resource :aws_route, "#{@name}-to-#{tf_safe(ip_address)}-peer-#{hash}",
298
298
  route_table_id: route_table,
299
299
  destination_cidr_block: cidr,
300
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: 2.0.1
4
+ version: 2.0.6
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-08-26 00:00:00.000000000 Z
11
+ date: 2020-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake