-
Notifications
You must be signed in to change notification settings - Fork 0
/
tls_keys.tf
33 lines (28 loc) · 1.09 KB
/
tls_keys.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
# ---------------------------------------------------------------------------------------------------------------------
# Resources
# ---------------------------------------------------------------------------------------------------------------------
# Generate "deploy key" to be used by Flux
resource "tls_private_key" "cluster_keys" {
for_each = local.environments_keys_create
algorithm = "RSA"
rsa_bits = 4096
}
resource "tls_private_key" "ns_keys" {
for_each = local.ns_keys_create
algorithm = "RSA"
rsa_bits = 4096
}
# ---------------------------------------------------------------------------------------------------------------------
# Computations
# ---------------------------------------------------------------------------------------------------------------------
locals {
environments_keys_create = setunion(keys(local.environments_clusters), ["_ci"])
ns_keys_create = toset(
[
for pair in setproduct(
[for id, repo in local.namespaces_repos : id if repo.type == "ops"],
local.environments_keys_create
) : "${pair[0]}_${pair[1]}"
]
)
}