From 3220c109dbfd17fd3b1a2e86164099354716e4e4 Mon Sep 17 00:00:00 2001 From: Agnieszka Figiel Date: Fri, 17 Nov 2023 08:41:55 +0100 Subject: [PATCH] Moved klab password to secrets --- infrastructure/base/modules/env/main.tf | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/infrastructure/base/modules/env/main.tf b/infrastructure/base/modules/env/main.tf index aa81301db..8734a2605 100644 --- a/infrastructure/base/modules/env/main.tf +++ b/infrastructure/base/modules/env/main.tf @@ -100,6 +100,14 @@ module "nextauth_secret" { use_random_value = true } +module "klab_api_password" { + source = "../secret_value" + region = var.gcp_region + key = "${var.project_name}_klab_api_password" + value = var.klab_api_password + use_random_value = false +} + locals { frontend_docker_build_args = { TRANSIFEX_TOKEN = var.transifex_token @@ -240,6 +248,9 @@ module "backend_cloudrun" { }, { name = "ENCRYPTION_DERIVATION_SALT" secret_name = module.rails_encryption_derivation_salt.secret_name + }, { + name = "KLAB_API_PASSWORD" + secret_name = module.klab_api_password.secret_name }, length(module.http_auth_password) > 0 ? [{ name = "HTTP_AUTH_PASSWORD" secret_name = module.http_auth_password[0].secret_name @@ -338,10 +349,6 @@ module "backend_cloudrun" { name = "KLAB_API_USERNAME" value = var.klab_api_username }, - { - name = "KLAB_API_PASSWORD" - value = var.klab_api_password - }, { name = "KLAB_ENABLED" value = var.klab_enabled @@ -384,6 +391,9 @@ module "jobs_cloudrun" { }, { name = "ENCRYPTION_DERIVATION_SALT" secret_name = module.rails_encryption_derivation_salt.secret_name + }, { + name = "KLAB_API_PASSWORD" + secret_name = module.klab_api_password.secret_name } ] env_vars = [ @@ -475,10 +485,6 @@ module "jobs_cloudrun" { name = "KLAB_API_USERNAME" value = var.klab_api_username }, - { - name = "KLAB_API_PASSWORD" - value = var.klab_api_password - }, { name = "KLAB_ENABLED" value = var.klab_enabled