From 502da48b57354be6b3ede9138ae470858e31b715 Mon Sep 17 00:00:00 2001 From: Oguzhan Unlu Date: Tue, 12 Dec 2023 12:54:12 +0300 Subject: [PATCH] Accept user input for version and config (close #25) --- README.md | 1 + main.tf | 2 +- variables.tf | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7316cbd..273b985 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ module "transformer_kinesis" { | [transformer\_compression](#input\_transformer\_compression) | Transformer output compression, GZIP or NONE | `string` | `"GZIP"` | no | | [user\_provided\_id](#input\_user\_provided\_id) | An optional unique identifier to identify the telemetry events emitted by this stack | `string` | `""` | no | | [widerow\_file\_format](#input\_widerow\_file\_format) | The output file\_format from the widerow transformation\_type selected (json or parquet) | `string` | `"json"` | no | +| [config\_override\_b64](#input\_config\_override\_b64) | App config uploaded as a base64 encoded blob. This variable facilitates dev flow, if config is incorrect this can break the deployment. | `string` | `""` | no | ## Outputs diff --git a/main.tf b/main.tf index efe524b..9d182d3 100644 --- a/main.tf +++ b/main.tf @@ -365,7 +365,7 @@ locals { }) user_data = templatefile("${path.module}/templates/user-data.sh.tmpl", { - config_b64 = base64encode(local.config) + config_b64 = var.config_override_b64 == "" ? base64encode(local.config) : var.config_override_b64 iglu_resolver_b64 = base64encode(local.iglu_resolver) version = local.app_version diff --git a/variables.tf b/variables.tf index 3eba6d6..f190228 100644 --- a/variables.tf +++ b/variables.tf @@ -3,6 +3,12 @@ variable "name" { type = string } +variable "config_override_b64" { + description = "App config uploaded as a base64 encoded blob. This variable facilitates dev flow, if config is incorrect this can break the deployment." + type = string + default = "" +} + variable "vpc_id" { description = "The VPC to deploy Transformer within" type = string