terrafying-components 1.7.2 → 1.7.3
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/ca.rb +4 -0
- data/lib/terrafying/components/instanceprofile.rb +4 -1
- data/lib/terrafying/components/loadbalancer.rb +0 -1
- data/lib/terrafying/components/selfsignedca.rb +4 -0
- data/lib/terrafying/components/service.rb +9 -4
- data/lib/terrafying/components/templates/ignition.yaml +3 -3
- data/lib/terrafying/components/version.rb +1 -1
- 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: 4a9bc69b9f076bd59fa7922ff83f0c59e472e570ba28b40dd29631e7d8378a90
|
4
|
+
data.tar.gz: 0c8c6f2131804dfb187d63d3db89d9b21d2f4c14f213ee9e42e88683eede6016
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06fac52650040faef41a28e93a497ff9c8faf7aef38e83fa0eea0e79b943b8cb1597fccdcc6d1c71d9959aba5e623a5ecfda48c9d3cf88ebe1c13a9d6265c3db
|
7
|
+
data.tar.gz: 5bd0f0c64239f5173cb69410ca84fafd1d9b3b11069a4e097434ab433543d3bd98156c5f79a615bf8254a127ca9bae484c9c5486483235405151d949a5bba3ee
|
@@ -15,6 +15,10 @@ module Terrafying
|
|
15
15
|
ref = {
|
16
16
|
name: name,
|
17
17
|
ca: self,
|
18
|
+
path: {
|
19
|
+
cert: File.join("/etc/ssl", @name, name, "cert"),
|
20
|
+
key: File.join("/etc/ssl", @name, name, "key"),
|
21
|
+
},
|
18
22
|
source: {
|
19
23
|
cert: File.join("s3://", @bucket, @prefix, @name, name, "cert"),
|
20
24
|
key: File.join("s3://", @bucket, @prefix, @name, name, "key"),
|
@@ -5,7 +5,7 @@ module Terrafying
|
|
5
5
|
|
6
6
|
class InstanceProfile < Terrafying::Context
|
7
7
|
|
8
|
-
attr_reader :id
|
8
|
+
attr_reader :id, :role_arn, :role_resource
|
9
9
|
|
10
10
|
def self.create(name, options={})
|
11
11
|
InstanceProfile.new.create name, options
|
@@ -74,6 +74,9 @@ module Terrafying
|
|
74
74
|
role: output_of(:aws_iam_role, name, :name),
|
75
75
|
}
|
76
76
|
|
77
|
+
@role_arn = output_of(:aws_iam_role, name, :arn)
|
78
|
+
@role_resource = "aws_iam_role.#{name}"
|
79
|
+
|
77
80
|
self
|
78
81
|
end
|
79
82
|
end
|
@@ -86,6 +86,10 @@ module Terrafying
|
|
86
86
|
|
87
87
|
{
|
88
88
|
ca: self,
|
89
|
+
path: {
|
90
|
+
cert: File.join("/etc/ssl", @name, "ca.cert"),
|
91
|
+
key: File.join("/etc/ssl", @name, "ca.key"),
|
92
|
+
},
|
89
93
|
source: {
|
90
94
|
cert: File.join("s3://", @bucket, @prefix, @name, "ca.cert"),
|
91
95
|
key: File.join("s3://", @bucket, @prefix, @name, "ca.key"),
|
@@ -20,7 +20,7 @@ module Terrafying
|
|
20
20
|
|
21
21
|
class Service < Terrafying::Context
|
22
22
|
|
23
|
-
attr_reader :name, :domain_names, :ports, :load_balancer, :instance_set
|
23
|
+
attr_reader :name, :domain_names, :ports, :instance_profile, :load_balancer, :instance_set
|
24
24
|
|
25
25
|
include Usable
|
26
26
|
|
@@ -87,16 +87,21 @@ module Terrafying
|
|
87
87
|
depends_on = options[:depends_on] + options[:keypairs].map{ |kp| kp[:resources] }.flatten
|
88
88
|
|
89
89
|
iam_statements = options[:iam_policy_statements] + options[:keypairs].map { |kp| kp[:iam_statement] }
|
90
|
-
instance_profile = add! InstanceProfile.create(ident, { statements: iam_statements })
|
90
|
+
@instance_profile = add! InstanceProfile.create(ident, { statements: iam_statements })
|
91
91
|
|
92
92
|
tags = options[:tags].merge({ service_name: name })
|
93
93
|
|
94
94
|
set = options[:instances].is_a?(Hash) ? DynamicSet : StaticSet
|
95
95
|
|
96
|
-
|
96
|
+
if options.has_key?(:loadbalancer) # explicitly requested or rejected a loadbalancer
|
97
|
+
wants_load_balancer = options[:loadbalancer]
|
98
|
+
else
|
99
|
+
# by default we want one if we are an ASG with exposed ports
|
100
|
+
wants_load_balancer = set == DynamicSet && @ports.count > 0
|
101
|
+
end
|
97
102
|
|
98
103
|
instance_set_options = {
|
99
|
-
instance_profile: instance_profile,
|
104
|
+
instance_profile: @instance_profile,
|
100
105
|
depends_on: depends_on,
|
101
106
|
tags: tags,
|
102
107
|
}
|
@@ -83,14 +83,14 @@ storage:
|
|
83
83
|
<% keypairs.each { |keypair| %>
|
84
84
|
<% if keypair.has_key?(:name) %>
|
85
85
|
- filesystem: "root"
|
86
|
-
path: "
|
86
|
+
path: "<%= keypair[:path][:cert] %>"
|
87
87
|
mode: 0444
|
88
88
|
user: { id: 0 }
|
89
89
|
group: { id: 0 }
|
90
90
|
contents:
|
91
91
|
source: "<%= keypair[:source][:cert] %>"
|
92
92
|
- filesystem: "root"
|
93
|
-
path: "
|
93
|
+
path: "<%= keypair[:path][:key] %>"
|
94
94
|
mode: 0444
|
95
95
|
user: { id: 0 }
|
96
96
|
group: { id: 0 }
|
@@ -98,7 +98,7 @@ storage:
|
|
98
98
|
source: "<%= keypair[:source][:key] %>"
|
99
99
|
<% else %>
|
100
100
|
- filesystem: "root"
|
101
|
-
path: "
|
101
|
+
path: "<%= keypair[:path][:key] %>"
|
102
102
|
mode: 0444
|
103
103
|
user: { id: 0 }
|
104
104
|
group: { id: 0 }
|
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.7.
|
4
|
+
version: 1.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- uSwitch Limited
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|