Skip to content

Commit

Permalink
feat(API gateway MySQL access): give API gateway env variable MYSQL_URI
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasHuber committed Jan 31, 2024
1 parent 79e1902 commit 46504e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/api/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ module "server" {
redis_url = var.redis_url
secrets = module.secrets
sentry_dsn = var.server.sentry_dsn
serlo_org_database_url = var.database_layer.database_url
google_service_account = var.server.google_service_account
google_spreadsheet_api = var.google_spreadsheet_api
rocket_chat_api = var.rocket_chat_api
Expand Down
9 changes: 9 additions & 0 deletions modules/api/server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ variable "redis_url" {
type = string
}

variable "serlo_org_database_url" {
type = string
}

variable "google_service_account" {
description = "Google service account key"
type = string
Expand Down Expand Up @@ -356,6 +360,11 @@ resource "kubernetes_deployment" "server" {
value = var.openai_api_key
}

env {
name = "MYSQL_URI"
value = var.serlo_org_database_url
}

volume_mount {
mount_path = "/etc/google_service_account/key.json"
sub_path = "key.json"
Expand Down

0 comments on commit 46504e1

Please sign in to comment.