@@ -73,15 +73,15 @@ resource "google_bigquery_table" "main" {
73
73
labels = each. value [" labels" ]
74
74
schema = each. value [" schema" ]
75
75
clustering = each. value [" clustering" ]
76
- expiration_time = each. value [" expiration_time" ]
76
+ expiration_time = each. value [" expiration_time" ] != null ? each . value [ " expiration_time " ] : 0
77
77
project = var. project_id
78
78
deletion_protection = var. deletion_protection
79
79
80
80
dynamic "time_partitioning" {
81
81
for_each = each. value [" time_partitioning" ] != null ? [each . value [" time_partitioning" ]] : []
82
82
content {
83
83
type = time_partitioning. value [" type" ]
84
- expiration_ms = time_partitioning. value [" expiration_ms" ]
84
+ expiration_ms = time_partitioning. value [" expiration_ms" ] != null ? time_partitioning . value [ " expiration_ms " ] : 0
85
85
field = time_partitioning. value [" field" ]
86
86
require_partition_filter = time_partitioning. value [" require_partition_filter" ]
87
87
}
@@ -136,15 +136,15 @@ resource "google_bigquery_table" "materialized_view" {
136
136
description = each. value [" description" ]
137
137
labels = each. value [" labels" ]
138
138
clustering = each. value [" clustering" ]
139
- expiration_time = each. value [" expiration_time" ]
139
+ expiration_time = each. value [" expiration_time" ] != null ? each . value [ " expiration_time " ] : 0
140
140
project = var. project_id
141
141
deletion_protection = false
142
142
143
143
dynamic "time_partitioning" {
144
144
for_each = each. value [" time_partitioning" ] != null ? [each . value [" time_partitioning" ]] : []
145
145
content {
146
146
type = time_partitioning. value [" type" ]
147
- expiration_ms = time_partitioning. value [" expiration_ms" ]
147
+ expiration_ms = time_partitioning. value [" expiration_ms" ] != null ? time_partitioning . value [ " expiration_ms " ] : 0
148
148
field = time_partitioning. value [" field" ]
149
149
require_partition_filter = time_partitioning. value [" require_partition_filter" ]
150
150
}
@@ -182,7 +182,7 @@ resource "google_bigquery_table" "external_table" {
182
182
table_id = each. key
183
183
description = each. value [" description" ]
184
184
labels = each. value [" labels" ]
185
- expiration_time = each. value [" expiration_time" ]
185
+ expiration_time = each. value [" expiration_time" ] != null ? each . value [ " expiration_time " ] : 0
186
186
project = var. project_id
187
187
deletion_protection = var. deletion_protection
188
188
0 commit comments