Skip to content

Commit efd7b4e

Browse files
committed
add default values for input variables
1 parent ab7fbda commit efd7b4e

File tree

3 files changed

+39
-39
lines changed

3 files changed

+39
-39
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@ This module provisions a dataset and a list of tables with associated JSON schem
198198
| encryption\_key | Default encryption key to apply to the dataset. Defaults to null (Google-managed). | `string` | `null` | no |
199199
| external\_tables | A list of objects which include table\_id, expiration\_time, external\_data\_configuration, and labels. | <pre>list(object({<br> table_id = string,<br> description = optional(string),<br> autodetect = bool,<br> compression = string,<br> ignore_unknown_values = bool,<br> max_bad_records = number,<br> schema = string,<br> source_format = string,<br> source_uris = list(string),<br> csv_options = object({<br> quote = string,<br> allow_jagged_rows = bool,<br> allow_quoted_newlines = bool,<br> encoding = string,<br> field_delimiter = string,<br> skip_leading_rows = number,<br> }),<br> google_sheets_options = object({<br> range = string,<br> skip_leading_rows = number,<br> }),<br> hive_partitioning_options = object({<br> mode = string,<br> source_uri_prefix = string,<br> }),<br> expiration_time = string,<br> max_staleness = optional(string),<br> deletion_protection = optional(bool),<br> labels = map(string),<br> }))</pre> | `[]` | no |
200200
| location | The regional location for the dataset only US and EU are allowed in module | `string` | `"US"` | no |
201-
| materialized\_views | A list of objects which includes view\_id, view\_query, clustering, time\_partitioning, range\_partitioning, expiration\_time and labels | <pre>list(object({<br> view_id = string,<br> description = optional(string),<br> query = string,<br> enable_refresh = bool,<br> refresh_interval_ms = string,<br> clustering = list(string),<br> time_partitioning = object({<br> expiration_ms = string,<br> field = string,<br> type = string,<br> require_partition_filter = bool,<br> }),<br> range_partitioning = object({<br> field = string,<br> range = object({<br> start = string,<br> end = string,<br> interval = string,<br> }),<br> }),<br> expiration_time = string,<br> max_staleness = optional(string),<br> labels = map(string),<br> }))</pre> | `[]` | no |
201+
| materialized\_views | A list of objects which includes view\_id, view\_query, clustering, time\_partitioning, range\_partitioning, expiration\_time and labels | <pre>list(object({<br> view_id = string,<br> description = optional(string),<br> query = string,<br> enable_refresh = bool,<br> refresh_interval_ms = string,<br> clustering = optional(list(string), []),<br> time_partitioning = optional(object({<br> expiration_ms = string,<br> field = string,<br> type = string,<br> require_partition_filter = bool,<br> }), null),<br> range_partitioning = optional(object({<br> field = string,<br> range = object({<br> start = string,<br> end = string,<br> interval = string,<br> }),<br> }), null),<br> expiration_time = optional(string, null),<br> max_staleness = optional(string),<br> labels = optional(map(string), {}),<br> }))</pre> | `[]` | no |
202202
| max\_time\_travel\_hours | Defines the time travel window in hours | `number` | `null` | no |
203203
| project\_id | Project where the dataset and table are created | `string` | n/a | yes |
204204
| resource\_tags | A map of resource tags to add to the dataset | `map(string)` | `{}` | no |
205-
| routines | A list of objects which include routine\_id, routine\_type, routine\_language, definition\_body, return\_type, routine\_description and arguments. | <pre>list(object({<br> routine_id = string,<br> routine_type = string,<br> language = string,<br> definition_body = string,<br> return_type = string,<br> description = string,<br> arguments = list(object({<br> name = string,<br> data_type = string,<br> argument_kind = string,<br> mode = string,<br> })),<br> }))</pre> | `[]` | no |
205+
| routines | A list of objects which include routine\_id, routine\_type, routine\_language, definition\_body, return\_type, routine\_description and arguments. | <pre>list(object({<br> routine_id = string,<br> routine_type = string,<br> language = string,<br> definition_body = string,<br> return_type = string,<br> description = string,<br> arguments = optional(list(object({<br> name = string,<br> data_type = string,<br> argument_kind = string,<br> mode = string,<br> })), []),<br> }))</pre> | `[]` | no |
206206
| storage\_billing\_model | Specifies the storage billing model for the dataset. Set this flag value to LOGICAL to use logical bytes for storage billing, or to PHYSICAL to use physical bytes instead. LOGICAL is the default if this flag isn't specified. | `string` | `null` | no |
207-
| tables | A list of objects which include table\_id, table\_name, schema, clustering, time\_partitioning, range\_partitioning, expiration\_time and labels. | <pre>list(object({<br> table_id = string,<br> description = optional(string),<br> table_name = optional(string),<br> schema = string,<br> clustering = list(string),<br> require_partition_filter = optional(bool),<br> time_partitioning = object({<br> expiration_ms = string,<br> field = string,<br> type = string,<br> }),<br> range_partitioning = object({<br> field = string,<br> range = object({<br> start = string,<br> end = string,<br> interval = string,<br> }),<br> }),<br> expiration_time = string,<br> deletion_protection = optional(bool),<br> labels = map(string),<br> }))</pre> | `[]` | no |
208-
| views | A list of objects which include view\_id and view query | <pre>list(object({<br> view_id = string,<br> description = optional(string),<br> query = string,<br> use_legacy_sql = bool,<br> labels = map(string),<br> }))</pre> | `[]` | no |
207+
| tables | A list of objects which include table\_id, table\_name, schema, clustering, time\_partitioning, range\_partitioning, expiration\_time and labels. | <pre>list(object({<br> table_id = string,<br> description = optional(string),<br> table_name = optional(string),<br> schema = string,<br> clustering = optional(list(string), []),<br> require_partition_filter = optional(bool),<br> time_partitioning = optional(object({<br> expiration_ms = string,<br> field = string,<br> type = string,<br> }), null),<br> range_partitioning = optional(object({<br> field = string,<br> range = object({<br> start = string,<br> end = string,<br> interval = string,<br> }),<br> }), null),<br> expiration_time = optional(string, null),<br> deletion_protection = optional(bool),<br> labels = optional(map(string), {}),<br> }))</pre> | `[]` | no |
208+
| views | A list of objects which include view\_id and view query | <pre>list(object({<br> view_id = string,<br> description = optional(string),<br> query = string,<br> use_legacy_sql = bool,<br> labels = optional(map(string), {}),<br> }))</pre> | `[]` | no |
209209

210210
## Outputs
211211

metadata.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
source:
2525
repo: https://github.com/terraform-google-modules/terraform-google-bigquery
2626
sourceType: git
27-
version: 10.0.0
27+
version: 10.0.1
2828
actuationTool:
2929
flavor: Terraform
3030
version: ">= 1.3"
@@ -114,24 +114,24 @@ spec:
114114
description = optional(string),
115115
table_name = optional(string),
116116
schema = string,
117-
clustering = list(string),
117+
clustering = optional(list(string), []),
118118
require_partition_filter = optional(bool),
119-
time_partitioning = object({
119+
time_partitioning = optional(object({
120120
expiration_ms = string,
121121
field = string,
122122
type = string,
123-
}),
124-
range_partitioning = object({
123+
}), null),
124+
range_partitioning = optional(object({
125125
field = string,
126126
range = object({
127127
start = string,
128128
end = string,
129129
interval = string,
130130
}),
131-
}),
132-
expiration_time = string,
131+
}), null),
132+
expiration_time = optional(string, null),
133133
deletion_protection = optional(bool),
134-
labels = map(string),
134+
labels = optional(map(string), {}),
135135
}))
136136
defaultValue: []
137137
- name: views
@@ -142,7 +142,7 @@ spec:
142142
description = optional(string),
143143
query = string,
144144
use_legacy_sql = bool,
145-
labels = map(string),
145+
labels = optional(map(string), {}),
146146
}))
147147
defaultValue: []
148148
- name: materialized_views
@@ -154,24 +154,24 @@ spec:
154154
query = string,
155155
enable_refresh = bool,
156156
refresh_interval_ms = string,
157-
clustering = list(string),
158-
time_partitioning = object({
157+
clustering = optional(list(string), []),
158+
time_partitioning = optional(object({
159159
expiration_ms = string,
160160
field = string,
161161
type = string,
162162
require_partition_filter = bool,
163-
}),
164-
range_partitioning = object({
163+
}), null),
164+
range_partitioning = optional(object({
165165
field = string,
166166
range = object({
167167
start = string,
168168
end = string,
169169
interval = string,
170170
}),
171-
}),
172-
expiration_time = string,
171+
}), null),
172+
expiration_time = optional(string, null),
173173
max_staleness = optional(string),
174-
labels = map(string),
174+
labels = optional(map(string), {}),
175175
}))
176176
defaultValue: []
177177
- name: external_tables
@@ -219,12 +219,12 @@ spec:
219219
definition_body = string,
220220
return_type = string,
221221
description = string,
222-
arguments = list(object({
222+
arguments = optional(list(object({
223223
name = string,
224224
data_type = string,
225225
argument_kind = string,
226226
mode = string,
227-
})),
227+
})), []),
228228
}))
229229
defaultValue: []
230230
outputs:

variables.tf

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -125,24 +125,24 @@ variable "tables" {
125125
description = optional(string),
126126
table_name = optional(string),
127127
schema = string,
128-
clustering = list(string),
128+
clustering = optional(list(string), []),
129129
require_partition_filter = optional(bool),
130-
time_partitioning = object({
130+
time_partitioning = optional(object({
131131
expiration_ms = string,
132132
field = string,
133133
type = string,
134-
}),
135-
range_partitioning = object({
134+
}), null),
135+
range_partitioning = optional(object({
136136
field = string,
137137
range = object({
138138
start = string,
139139
end = string,
140140
interval = string,
141141
}),
142-
}),
143-
expiration_time = string,
142+
}), null),
143+
expiration_time = optional(string, null),
144144
deletion_protection = optional(bool),
145-
labels = map(string),
145+
labels = optional(map(string), {}),
146146
}))
147147
}
148148

@@ -154,7 +154,7 @@ variable "views" {
154154
description = optional(string),
155155
query = string,
156156
use_legacy_sql = bool,
157-
labels = map(string),
157+
labels = optional(map(string), {}),
158158
}))
159159
}
160160

@@ -167,24 +167,24 @@ variable "materialized_views" {
167167
query = string,
168168
enable_refresh = bool,
169169
refresh_interval_ms = string,
170-
clustering = list(string),
171-
time_partitioning = object({
170+
clustering = optional(list(string), []),
171+
time_partitioning = optional(object({
172172
expiration_ms = string,
173173
field = string,
174174
type = string,
175175
require_partition_filter = bool,
176-
}),
177-
range_partitioning = object({
176+
}), null),
177+
range_partitioning = optional(object({
178178
field = string,
179179
range = object({
180180
start = string,
181181
end = string,
182182
interval = string,
183183
}),
184-
}),
185-
expiration_time = string,
184+
}), null),
185+
expiration_time = optional(string, null),
186186
max_staleness = optional(string),
187-
labels = map(string),
187+
labels = optional(map(string), {}),
188188
}))
189189
}
190190

@@ -235,11 +235,11 @@ variable "routines" {
235235
definition_body = string,
236236
return_type = string,
237237
description = string,
238-
arguments = list(object({
238+
arguments = optional(list(object({
239239
name = string,
240240
data_type = string,
241241
argument_kind = string,
242242
mode = string,
243-
})),
243+
})), []),
244244
}))
245245
}

0 commit comments

Comments
 (0)