From 509d25f4ed52f17e5fc311251ac251e69cc15e25 Mon Sep 17 00:00:00 2001 From: paduin Date: Thu, 18 Apr 2024 14:59:05 +0200 Subject: [PATCH 1/5] added variable to extend config more easily --- README.md | 3 +++ templates.tf | 1 + templates/waggle-dance-server.yml.tmpl | 1 + variables.tf | 25 +++++++++++++++++++++++++ 4 files changed, 30 insertions(+) diff --git a/README.md b/README.md index 4dc8844..7d6802d 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,9 @@ For more information please refer to the main [Apiary](https://github.com/Expedi | datadog_agent_version | Version of the Datadog Agent running in the ECS cluster. | string | `7.46.0-jmx` | no | | include_datadog_agent | Whether to include the datadog-agent container alongside Waggledance. | string | bool | no | | metrics_port | The port on which the WaggleDance application initiates. Additionally, it serves as the port from which we parse metrics. | string | `18000` | yes | +| extended_server_config | Extended waggle-dance-server.yml configuration for Waggle Dance (see [Waggle Dance README](https://github.com/ExpediaGroup/waggle-dance/blob/main/README.md) for all options). String will be [yamlencoded](https://developer.hashicorp.com/terraform/language/functions/yamlencode). | string | `18000` | yes | + + ## Usage diff --git a/templates.tf b/templates.tf index fee7052..5a935c9 100644 --- a/templates.tf +++ b/templates.tf @@ -35,6 +35,7 @@ data "template_file" "server_yaml" { enable_query_functions_across_all_metastores = var.enable_query_functions_across_all_metastores graphite = join("", data.template_file.graphite_server_yaml.*.rendered) exposed_endpoints = data.template_file.endpoints_server_yaml.rendered + extended_server_config = yamlencode(var.extended_server_config) } } diff --git a/templates/waggle-dance-server.yml.tmpl b/templates/waggle-dance-server.yml.tmpl index d0bc7d4..5433340 100644 --- a/templates/waggle-dance-server.yml.tmpl +++ b/templates/waggle-dance-server.yml.tmpl @@ -5,3 +5,4 @@ yaml-storage: overwrite-config-on-shutdown: false ${graphite} ${exposed_endpoints} +${extended_server_config} diff --git a/variables.tf b/variables.tf index 64724a1..c06d34d 100644 --- a/variables.tf +++ b/variables.tf @@ -408,3 +408,28 @@ variable "include_datadog_agent" { default = false } +/* +Example: +extended_server_config = <" + nodeAddresses: + - "rediss://localhost1:62493" + - "rediss://localhost2:62493" +EOT +*/ +variable "extended_server_config" { + description = "Extended waggle-dance-server.yml configuration for Waggle Dance. String will be yamlencoded (https://developer.hashicorp.com/terraform/language/functions/yamlencode)." + type = string + default = "" +} From 70037e094a4a4206ca4bdd9f81f75f53bb7dbcdd Mon Sep 17 00:00:00 2001 From: paduin Date: Fri, 19 Apr 2024 12:14:28 +0200 Subject: [PATCH 2/5] typo --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index c06d34d..b4d0c45 100644 --- a/variables.tf +++ b/variables.tf @@ -412,7 +412,7 @@ variable "include_datadog_agent" { Example: extended_server_config = < Date: Fri, 19 Apr 2024 15:31:44 +0200 Subject: [PATCH 3/5] testing --- templates.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates.tf b/templates.tf index 5a935c9..7cae0d3 100644 --- a/templates.tf +++ b/templates.tf @@ -35,7 +35,7 @@ data "template_file" "server_yaml" { enable_query_functions_across_all_metastores = var.enable_query_functions_across_all_metastores graphite = join("", data.template_file.graphite_server_yaml.*.rendered) exposed_endpoints = data.template_file.endpoints_server_yaml.rendered - extended_server_config = yamlencode(var.extended_server_config) + extended_server_config = var.extended_server_config } } From f9c4d4361cc125f301da15ddc966e3cb0d5c5268 Mon Sep 17 00:00:00 2001 From: paduin Date: Fri, 19 Apr 2024 15:40:44 +0200 Subject: [PATCH 4/5] testing --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index b4d0c45..c6c6a3f 100644 --- a/variables.tf +++ b/variables.tf @@ -429,7 +429,7 @@ waggledance.extensions.ratelimit.reddison.embedded.config: | EOT */ variable "extended_server_config" { - description = "Extended waggle-dance-server.yml configuration for Waggle Dance. String will be yamlencoded (https://developer.hashicorp.com/terraform/language/functions/yamlencode)." + description = "Extended waggle-dance-server.yml configuration for Waggle Dance. This is a YAML string." type = string default = "" } From 310b33c048249f4091d2e2b814e366a110939555 Mon Sep 17 00:00:00 2001 From: paduin Date: Wed, 24 Apr 2024 13:49:17 +0200 Subject: [PATCH 5/5] changelog --- CHANGELOG.md | 4 ++++ README.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02dbc67..d3acffb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [4.4.0] - 2024-04-25 +### Added +- Added optional `extended_server_config`. For instance to configure Waggle Dance Rate limiting configuration. + ## [4.3.2] - 2024-03-26 ### Updated - Removed the datadog explicit provider configuration as suggested here: https://developer.hashicorp.com/terraform/language/modules/develop/providers#legacy-shared-modules-with-provider-configurations diff --git a/README.md b/README.md index 7d6802d..4d3b114 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ For more information please refer to the main [Apiary](https://github.com/Expedi | datadog_agent_version | Version of the Datadog Agent running in the ECS cluster. | string | `7.46.0-jmx` | no | | include_datadog_agent | Whether to include the datadog-agent container alongside Waggledance. | string | bool | no | | metrics_port | The port on which the WaggleDance application initiates. Additionally, it serves as the port from which we parse metrics. | string | `18000` | yes | -| extended_server_config | Extended waggle-dance-server.yml configuration for Waggle Dance (see [Waggle Dance README](https://github.com/ExpediaGroup/waggle-dance/blob/main/README.md) for all options). String will be [yamlencoded](https://developer.hashicorp.com/terraform/language/functions/yamlencode). | string | `18000` | yes | +| extended_server_config | Extended waggle-dance-server.yml configuration for Waggle Dance (see [Waggle Dance README](https://github.com/ExpediaGroup/waggle-dance/blob/main/README.md) for all options). String will be [yamlencoded](https://developer.hashicorp.com/terraform/language/functions/yamlencode). | string | | no |