terrafying-components 2.0.0 → 2.0.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 +4 -4
- data/lib/terrafying/components/dynamicset.rb +2 -2
- data/lib/terrafying/components/instance.rb +7 -12
- data/lib/terrafying/components/loadbalancer.rb +8 -3
- data/lib/terrafying/components/service.rb +2 -2
- data/lib/terrafying/components/staticset.rb +3 -3
- data/lib/terrafying/components/version.rb +1 -1
- data/lib/terrafying/components/vpc.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82d21aa59af747b2463c10fab573348d579483f2e6f6ce78e8632d2accaacc7c
|
4
|
+
data.tar.gz: 0bbb3d8b15e0089e2f81e217a869337cc0081f6563bee2290861b1c711619a1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f17fc4428503038066f3a9287be5d1d5a34a109d6812cd116999bf680e320fa8387603d49cd1060a5dae3f60c374a2f4b16beaa9ee20a54968b4b89ee93b5312
|
7
|
+
data.tar.gz: a9343d58ca92d4d5595bbbef4139a4c9159a32105bc0fe0f70941d27117f6d53bb166f2e3ad6d51790db228db736795b06594d1101fa4e9a69621d5a70073b14
|
@@ -33,7 +33,7 @@ module Terrafying
|
|
33
33
|
options = {
|
34
34
|
public: false,
|
35
35
|
eip: false,
|
36
|
-
ami: aws.ami('base-image-fc-
|
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
|
-
|
42
|
-
|
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:
|
66
|
-
prefix_list_ids:
|
67
|
-
security_groups:
|
68
|
-
self:
|
69
|
-
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
|
@@ -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-
|
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-
|
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
|
|
@@ -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
|
@@ -243,7 +244,7 @@ module Terrafying
|
|
243
244
|
subnets: @subnets.values.flatten
|
244
245
|
}.merge(options)
|
245
246
|
|
246
|
-
ident = tf_safe(ip_address)
|
247
|
+
ident = tf_safe(Digest::SHA256.bubblebabble(ip_address)[0..11]+ip_address)
|
247
248
|
|
248
249
|
if options[:tunnels].count > 2
|
249
250
|
raise 'You can only define a max of two tunnels'
|
@@ -293,7 +294,7 @@ module Terrafying
|
|
293
294
|
route_tables.product(cidrs).each do |route_table, cidr|
|
294
295
|
hash = Digest::SHA2.hexdigest "#{route_table}-#{tf_safe(cidr)}"
|
295
296
|
|
296
|
-
resource :aws_route, "#{@name}-to-#{
|
297
|
+
resource :aws_route, "#{@name}-to-#{tf_safe(ip_address)}-peer-#{hash}",
|
297
298
|
route_table_id: route_table,
|
298
299
|
destination_cidr_block: cidr,
|
299
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.
|
4
|
+
version: 2.0.5
|
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-
|
11
|
+
date: 2020-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|