Skip to content

Commit

Permalink
fix: adds a null check for expiration time (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
g-awmalik authored Oct 19, 2023
1 parent 405972a commit b7efc4d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ resource "google_bigquery_table" "main" {
labels = each.value["labels"]
schema = each.value["schema"]
clustering = each.value["clustering"]
expiration_time = each.value["expiration_time"]
expiration_time = each.value["expiration_time"] != null ? each.value["expiration_time"] : 0
project = var.project_id
deletion_protection = var.deletion_protection

dynamic "time_partitioning" {
for_each = each.value["time_partitioning"] != null ? [each.value["time_partitioning"]] : []
content {
type = time_partitioning.value["type"]
expiration_ms = time_partitioning.value["expiration_ms"]
expiration_ms = time_partitioning.value["expiration_ms"] != null ? time_partitioning.value["expiration_ms"] : 0
field = time_partitioning.value["field"]
require_partition_filter = time_partitioning.value["require_partition_filter"]
}
Expand Down Expand Up @@ -136,15 +136,15 @@ resource "google_bigquery_table" "materialized_view" {
description = each.value["description"]
labels = each.value["labels"]
clustering = each.value["clustering"]
expiration_time = each.value["expiration_time"]
expiration_time = each.value["expiration_time"] != null ? each.value["expiration_time"] : 0
project = var.project_id
deletion_protection = false

dynamic "time_partitioning" {
for_each = each.value["time_partitioning"] != null ? [each.value["time_partitioning"]] : []
content {
type = time_partitioning.value["type"]
expiration_ms = time_partitioning.value["expiration_ms"]
expiration_ms = time_partitioning.value["expiration_ms"] != null ? time_partitioning.value["expiration_ms"] : 0
field = time_partitioning.value["field"]
require_partition_filter = time_partitioning.value["require_partition_filter"]
}
Expand Down Expand Up @@ -182,7 +182,7 @@ resource "google_bigquery_table" "external_table" {
table_id = each.key
description = each.value["description"]
labels = each.value["labels"]
expiration_time = each.value["expiration_time"]
expiration_time = each.value["expiration_time"] != null ? each.value["expiration_time"] : 0
project = var.project_id
deletion_protection = var.deletion_protection

Expand Down

0 comments on commit b7efc4d

Please sign in to comment.