From d7014f1267db75b0c99b7a01fd3b26bf9f7e5412 Mon Sep 17 00:00:00 2001 From: Michael Burns Date: Fri, 14 Mar 2025 15:30:26 -0400 Subject: [PATCH] feat: support for aws s3 biglake tables --- main.tf | 5 ++++- variables.tf | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index a7ba03dc..b4bf71b6 100644 --- a/main.tf +++ b/main.tf @@ -190,15 +190,18 @@ resource "google_bigquery_table" "external_table" { max_staleness = each.value["max_staleness"] project = var.project_id deletion_protection = coalesce(each.value["deletion_protection"], var.deletion_protection) + schema = each.value["connection_id"] != null ? each.value["schema"] : null external_data_configuration { autodetect = each.value["autodetect"] compression = each.value["compression"] ignore_unknown_values = each.value["ignore_unknown_values"] max_bad_records = each.value["max_bad_records"] - schema = each.value["schema"] + schema = each.value["connection_id"] == null ? each.value["schema"] : null source_format = each.value["source_format"] source_uris = each.value["source_uris"] + connection_id = each.value["connection_id"] + metadata_cache_mode = each.value["metadata_cache_mode"] dynamic "csv_options" { for_each = each.value["csv_options"] != null ? [each.value["csv_options"]] : [] diff --git a/variables.tf b/variables.tf index 28ca7a8b..06923997 100644 --- a/variables.tf +++ b/variables.tf @@ -201,6 +201,7 @@ variable "external_tables" { schema = string, source_format = string, source_uris = list(string), + connection_id = optional(string), csv_options = object({ quote = string, allow_jagged_rows = bool, @@ -219,6 +220,7 @@ variable "external_tables" { }), expiration_time = optional(string, null), max_staleness = optional(string), + metadata_cache_mode = optional(string), deletion_protection = optional(bool), labels = optional(map(string), {}), }))