Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"]] : []
Expand Down
2 changes: 2 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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), {}),
}))
Expand Down