-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathca.tf
39 lines (37 loc) · 1.17 KB
/
ca.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# https://kubernetes.io/docs/setup/best-practices/certificates/
module "kubernetes_root_ca" {
source = "git::github.com/edsoncsouza/vishwakarma.git//modules/tls/certificate-authority"
self_signed = true
cert_config = {
common_name = "kubernetes-root-ca"
organization = "kubernetes"
validity_period_hours = "26280"
}
}
module "ca" {
source = "git::github.com/edsoncsouza/vishwakarma.git//modules/tls/certificate-authority"
for_each = {
kubernetes_ca = {
common_name = "kubernetes-ca"
organization = "kubernetes"
},
etcd_ca = {
common_name = "etcd-ca"
organization = "etcd"
},
kubernetes_front_proxy_ca = {
common_name = "kubernetes-front-proxy-ca"
organization = "kubernetes-front-proxy"
},
}
self_signed = false
ca_config = {
key_pem = module.kubernetes_root_ca.private_key_pem
cert_pem = module.kubernetes_root_ca.cert_pem
}
cert_config = {
common_name = lookup(each.value, "common_name", "")
organization = lookup(each.value, "organization", "")
validity_period_hours = lookup(each.value, "validity_period_hours", "26280")
}
}