Skip to content

Commit

Permalink
feat(ecs): add ability to add additional vars to control plane (#115)
Browse files Browse the repository at this point in the history
Signed-off-by: Orla Dunlop <orla.dunlop@engineering.digital.dwp.gov.uk>
  • Loading branch information
odunlop authored Oct 21, 2024
1 parent 07780c1 commit bef39ef
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ module "kong_ecs" {

nginx_custom_config = file(coalesce(var.nginx_custom_config_path, local.nginx_default_custom_config_path))

additional_vars = var.additional_vars

ssl_cert = var.ssl_cert
ssl_key = var.ssl_key
lua_ssl_cert = var.lua_ssl_cert
Expand Down
1 change: 1 addition & 0 deletions modules/ecs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ resource "aws_ecs_task_definition" "kong" {
db_password_arn = var.db_password_arn
pg_max_concurrent_queries = var.pg_max_concurrent_queries
pg_keepalive_timeout = var.pg_keepalive_timeout
additional_vars = var.additional_vars
kong_admin_gui_session_conf = var.kong_admin_gui_session_conf
log_group = var.log_group
admin_api_port = var.kong_ports.admin_api
Expand Down
5 changes: 5 additions & 0 deletions modules/ecs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -384,3 +384,8 @@ variable "vitals_tsdb_address" {
description = "Time series database address for Vitals e.g. my-prometheus.net:9090"
type = string
}

variable "additional_vars" {
description = "Map of additional environment variables to set in the Control Plane"
type = map(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 @@ -193,6 +193,14 @@
"name": "KONG_VITALS_TSDB_ADDRESS",
"value": "${vitals_tsdb_address}"
}
%{ if additional_vars != null }
%{ for name, value in additional_vars ~}
,{
"name": "${name}",
"value": "${value}"
}
%{ endfor ~}
%{ endif }
],
"secrets": [
{
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -890,3 +890,9 @@ variable "kong_plugins" {
type = list(string)
default = []
}

variable "additional_vars" {
description = "(Optional) Map of additional environment variables to set in the Control Plane"
type = map(string)
default = null
}

0 comments on commit bef39ef

Please sign in to comment.