store the aiostreams secret key in resource to keep it persistent [ci skip]

This commit is contained in:
Viktor Barzin 2026-01-03 23:13:55 +00:00
parent e4473efaea
commit 2a2a4e851a
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
2 changed files with 4 additions and 5 deletions

View file

@ -10,10 +10,9 @@ resource "kubernetes_namespace" "aiostreams" {
}
}
# resource "random_string" "random" {
# length = 50
# lower = true
# }
resource "random_id" "secret_key" {
byte_length = 32 # 32 bytes × 2 hex chars = 64 hex characters
}
resource "kubernetes_deployment" "aiostreams" {
metadata {
@ -49,7 +48,7 @@ resource "kubernetes_deployment" "aiostreams" {
}
env {
name = "SECRET_KEY"
value = substr(sha256(uuid()), 0, 64)
value = random_id.secret_key.hex
}
env {
name = "DATABASE_URI"

Binary file not shown.