Skip to content

Commit

Permalink
feat(*): add KONG_PLUGINS variable allowing to load other plugins (#93)
Browse files Browse the repository at this point in the history
Signed-off-by: Alvaro Lopez Hernandez <alvaro.lopezhernandez@engineering.digital.dwp.gov.uk>
alv-lop authored Nov 3, 2022
1 parent 8fcb924 commit dd83198
Showing 5 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -69,6 +69,7 @@ module "kong_ec2" {
kong_hybrid_conf = var.kong_hybrid_conf
kong_ports = var.kong_ports != null ? var.kong_ports : local.kong_ports["stand_alone"]
kong_ssl_uris = var.kong_ssl_uris
kong_plugins = var.kong_plugins
manager_host = var.manager_host
placement_tenancy = var.placement_tenancy
portal_host = var.portal_host
2 changes: 2 additions & 0 deletions modules/ec2/main.tf
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@ locals {
kong_ssl_uris = var.kong_ssl_uris
kong_hybrid_conf = var.kong_hybrid_conf
clear_database = var.kong_clear_database
kong_plugins = join(",", concat(["bundled"], var.kong_plugins))
})
ubuntu = templatefile("${path.module}/../../templates/ubuntu/cloud-init.sh", {
proxy_config = var.proxy_config
@@ -78,6 +79,7 @@ locals {
kong_ssl_uris = var.kong_ssl_uris
kong_hybrid_conf = var.kong_hybrid_conf
clear_database = var.kong_clear_database
kong_plugins = join(",", concat(["bundled"], var.kong_plugins))
})
}

6 changes: 6 additions & 0 deletions modules/ec2/variables.tf
Original file line number Diff line number Diff line change
@@ -573,3 +573,9 @@ variable "security_group_name" {
type = string
default = "kong-security-group"
}

variable "kong_plugins" {
description = "(Optional) List of Kong plugins, passed through the variable KONG_PLUGINS"
type = list(string)
default = []
}
2 changes: 2 additions & 0 deletions templates/amazon-linux/cloud-init.sh
Original file line number Diff line number Diff line change
@@ -395,6 +395,8 @@ KONG_CLUSTER_CONTROL_PLANE="${kong_hybrid_conf.endpoint}:${kong_ports.cluster}"
KONG_CLUSTER_TELEMETRY_ENDPOINT="${kong_hybrid_conf.endpoint}:${kong_ports.telemetry}"
%{ endif ~}
KONG_PLUGINS="${kong_plugins}"
%{ for key, value in kong_config ~}
${key}="${value}"
%{ endfor ~}
2 changes: 2 additions & 0 deletions templates/ubuntu/cloud-init.sh
Original file line number Diff line number Diff line change
@@ -399,6 +399,8 @@ KONG_CLUSTER_CONTROL_PLANE="${kong_hybrid_conf.endpoint}:${kong_ports.cluster}"
KONG_CLUSTER_TELEMETRY_ENDPOINT="${kong_hybrid_conf.endpoint}:${kong_ports.telemetry}"
%{ endif ~}
KONG_PLUGINS="${kong_plugins}"
%{ for key, value in kong_config ~}
${key}="${value}"
%{ endfor ~}

0 comments on commit dd83198

Please sign in to comment.