Skip to content

Commit

Permalink
feat(*): add KONG_PLUGINS variable allowing to load other plugins
Browse files Browse the repository at this point in the history
Signed-off-by: Alvaro Lopez Hernandez <[email protected]>
  • Loading branch information
alv-lop committed Nov 1, 2022
1 parent 8fcb924 commit 2209bdd
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions modules/ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
})
}

Expand Down
6 changes: 6 additions & 0 deletions modules/ec2/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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 ~}
Expand Down
2 changes: 2 additions & 0 deletions templates/ubuntu/cloud-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ~}
Expand Down

0 comments on commit 2209bdd

Please sign in to comment.