From eea3293b6eb33b434feb4e4fc0a48b4bc35156ec Mon Sep 17 00:00:00 2001 From: Alvaro Lopez <5921727+alv-lop@users.noreply.github.com> Date: Mon, 31 Oct 2022 09:41:34 +0000 Subject: [PATCH] feat(ecs): add KONG_PLUGINS variable allowing to load other plugins (#88) Signed-off-by: Alvaro Lopez Hernandez --- modules/ecs/main.tf | 2 ++ modules/ecs/variables.tf | 6 ++++++ templates/ecs/kong_control_plane.tpl | 4 ++++ templates/ecs/kong_data_plane.tpl | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/modules/ecs/main.tf b/modules/ecs/main.tf index e1ae09e..f5e1477 100644 --- a/modules/ecs/main.tf +++ b/modules/ecs/main.tf @@ -104,6 +104,7 @@ data "template_file" "kong_task_definition_cp" { cluster_cert = var.cluster_cert cluster_key = var.cluster_key kong_log_level = var.kong_log_level + kong_plugins = var.kong_plugins entrypoint = var.entrypoint custom_nginx_conf = base64encode(var.custom_nginx_conf) } @@ -171,6 +172,7 @@ data "template_file" "kong_task_definition_dp" { cluster_cert = var.cluster_cert cluster_key = var.cluster_key kong_log_level = var.kong_log_level + kong_plugins = var.kong_plugins entrypoint = var.entrypoint custom_nginx_conf = base64encode(var.custom_nginx_conf) } diff --git a/modules/ecs/variables.tf b/modules/ecs/variables.tf index ebdbbf3..d92b53d 100644 --- a/modules/ecs/variables.tf +++ b/modules/ecs/variables.tf @@ -336,3 +336,9 @@ variable "kong_portal_api_url" { description = "The Portal API URL of the Portal." type = string } + +variable "kong_plugins" { + description = "Comma-separated list of Kong plugins, passed through the variable KONG_PLUGINS" + type = string + default = "bundled" +} diff --git a/templates/ecs/kong_control_plane.tpl b/templates/ecs/kong_control_plane.tpl index f71ba7e..d4181a8 100644 --- a/templates/ecs/kong_control_plane.tpl +++ b/templates/ecs/kong_control_plane.tpl @@ -115,6 +115,10 @@ "name": "KONG_STATUS_SSL_CERT_KEY", "value": "/usr/local/kong/kong_clustering/cluster.key" }, + { + "name": "KONG_PLUGINS", + "value": "${kong_plugins}" + }, { "name": "KONG_DATABASE", "value": "postgres" diff --git a/templates/ecs/kong_data_plane.tpl b/templates/ecs/kong_data_plane.tpl index 2ec673a..a44e061 100644 --- a/templates/ecs/kong_data_plane.tpl +++ b/templates/ecs/kong_data_plane.tpl @@ -81,6 +81,10 @@ "name": "KONG_ROLE", "value": "data_plane" }, + { + "name": "KONG_PLUGINS", + "value": "${kong_plugins}" + }, { "name": "KONG_DATABASE", "value": "off"