From 26dee128730a9e7720024214456e04ee577d1b3a Mon Sep 17 00:00:00 2001 From: spenes Date: Thu, 1 Aug 2024 10:51:43 +0300 Subject: [PATCH] Make it possible to set legacyColumns in the config --- README.md | 1 + main.tf | 1 + templates/config.json.tmpl | 2 ++ variables.tf | 6 ++++++ 4 files changed, 10 insertions(+) diff --git a/README.md b/README.md index ab917d1..daacd57 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,7 @@ module "bigquery_loader_pubsub" { | [user\_provided\_id](#input\_user\_provided\_id) | An optional unique identifier to identify the telemetry events emitted by this stack | `string` | `""` | no | | [webhook\_collector](#input\_webhook\_collector) | Collector address used to gather monitoring alerts | `string` | `""` | no | | [skip\_schemas](#input\_skip\_schemas) | The list of schema keys which should be skipped (not loaded) to the warehouse | `list(string)` | `[]` | no | +| [legacy\_columns](#input\_legacy\_columns) | Schemas for which to use the legacy column style used by the v1 BigQuery Loader. For these columns, there is a column per _minor_ version of each schema. | `list(string)` | `[]` | no | | [healthcheck\_enabled](#input\_healthcheck\_enabled) | Whether or not to enable health check probe for GCP instance group | `bool` | `true` | no | ## Outputs diff --git a/main.tf b/main.tf index ef77876..93427f1 100644 --- a/main.tf +++ b/main.tf @@ -201,6 +201,7 @@ locals { bigquery_service_account_json_b64 = var.bigquery_service_account_json_b64 skip_schemas = jsonencode(var.skip_schemas) + legacy_columns = jsonencode(var.legacy_columns) webhook_collector = var.webhook_collector tags = jsonencode(var.labels) diff --git a/templates/config.json.tmpl b/templates/config.json.tmpl index 31a7256..ca6b8da 100644 --- a/templates/config.json.tmpl +++ b/templates/config.json.tmpl @@ -23,6 +23,8 @@ "skipSchemas": ${skip_schemas} + "legacyColumns": ${legacy_columns} + %{ if webhook_collector != "" ~} "monitoring": { "webhook": { diff --git a/variables.tf b/variables.tf index 4772a1e..05fd680 100644 --- a/variables.tf +++ b/variables.tf @@ -220,6 +220,12 @@ variable "skip_schemas" { default = [] } +variable "legacy_columns" { + description = "Schemas for which to use the legacy column style used by the v1 BigQuery Loader. For these columns, there is a column per _minor_ version of each schema." + type = list(string) + default = [] +} + variable "healthcheck_enabled" { description = "Whether or not to enable health check probe for GCP instance group" type = bool