Skip to content

Commit 708b975

Browse files
committed
OPS: Add test BigQuery dataset to terraform config
1 parent 414699e commit 708b975

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

terraform/bigquery.tf

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
resource "google_bigquery_dataset" "test_dataset" {
2+
dataset_id = "octue_sdk_python_test_dataset"
3+
description = "A dataset for testing BigQuery subscriptions for the Octue SDK."
4+
location = "EU"
5+
default_table_expiration_ms = 3600000
6+
7+
labels = {
8+
env = "default"
9+
}
10+
}
11+
12+
resource "google_bigquery_table" "test_table" {
13+
dataset_id = google_bigquery_dataset.test_dataset.dataset_id
14+
table_id = "question-events"
15+
16+
labels = {
17+
env = "default"
18+
}
19+
20+
schema = <<EOF
21+
[
22+
{
23+
"name": "subscription_name",
24+
"type": "STRING",
25+
"mode": "REQUIRED"
26+
},
27+
{
28+
"name": "message_id",
29+
"type": "STRING",
30+
"mode": "REQUIRED"
31+
},
32+
{
33+
"name": "publish_time",
34+
"type": "TIMESTAMP",
35+
"mode": "REQUIRED"
36+
},
37+
{
38+
"name": "data",
39+
"type": "JSON",
40+
"mode": "REQUIRED",
41+
"description": "Octue service event (e.g. heartbeat, log record, result)."
42+
},
43+
{
44+
"name": "attributes",
45+
"type": "JSON",
46+
"mode": "REQUIRED",
47+
"description": "Metadata for routing the event, adding context, and guiding the receiver's behaviour."
48+
}
49+
]
50+
EOF
51+
}

0 commit comments

Comments
 (0)