Skip to content

Commit

Permalink
Add extra_db_users variable to pass through any DB users that need da…
Browse files Browse the repository at this point in the history
…tabase permissions

Signed-off-by: Matt Holmes <matthew.holmes@engineering.digital.dwp.gov.uk>
  • Loading branch information
mattholmes15 committed Aug 9, 2022
1 parent 05229f9 commit d066e49
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ module "kong_ecs" {
postgres_config = var.postgres_config
postgres_host = var.postgres_host
db_password_arn = var.db_password_arn
extra_db_users = var.extra_db_users

kong_vitals_enabled = var.kong_vitals_enabled
kong_portal_enabled = var.kong_portal_enabled
Expand Down
1 change: 1 addition & 0 deletions modules/ecs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ data "template_file" "kong_task_definition_cp" {
ulimits = jsonencode([4096])
region = var.region
access_log_format = var.access_log_format
extra_db_users = var.extra_db_users
error_log_format = var.error_log_format
ssl_cert = var.ssl_cert
ssl_key = var.ssl_key
Expand Down
5 changes: 5 additions & 0 deletions modules/ecs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,8 @@ variable "kong_portal_enabled" {
description = "Define whether or not the Kong Portal should be enabled."
type = string
}

variable "extra_db_users" {
description = "Define any extra Database Users that require permissions to access the Kong Database, e.g portal"
type = string
}
8 changes: 8 additions & 0 deletions templates/ecs/kong_control_plane.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"name": "AWS_REGION",
"value": "${region}"
},
{
"name": "EXTRA_DB_USERS",
"value": "${extra_db_users}"
},
{
"name": "KONG_CLUSTER_MTLS",
"value": "shared"
Expand Down Expand Up @@ -180,6 +184,10 @@
"valueFrom": "${db_password_arn}"
},
{
"name": "PGPASSWORD",
"valueFrom": "${db_password_arn}"
},
{
"name": "KONG_ADMIN_GUI_SESSION_CONF",
"valueFrom": "${kong_admin_gui_session_conf}"
},
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -799,3 +799,8 @@ variable "kong_portal_enabled" {
type = string
default = "on"
}

variable "extra_db_users" {
description = "Define any extra Database Users that require permissions to access the Kong Database, e.g portal"
type = string
}

0 comments on commit d066e49

Please sign in to comment.