twenty/packages/twenty-docker/k8s/terraform/secret.tf
Ciara Hatcher db9ec58f5d
Updating terraform and k8s files adding redis... (#7425)
Also updated the way secrets are generated with Terraform and some code
cleanup
2024-10-07 10:23:42 +02:00

29 lines
593 B
HCL

locals {
tokens = [
"accessToken",
"loginToken",
"refreshToken",
"fileToken"
]
}
resource "random_bytes" "this" {
for_each = toset(local.tokens)
length = 32
}
resource "kubernetes_secret" "twentycrm_tokens" {
metadata {
name = "tokens"
namespace = kubernetes_namespace.twentycrm.metadata.0.name
}
data = {
accessToken = random_bytes.this["accessToken"].base64
loginToken = random_bytes.this["loginToken"].base64
refreshToken = random_bytes.this["refreshToken"].base64
fileToken = random_bytes.this["fileToken"].base64
}
}