Skip to content

Commit

Permalink
OPS: Add test BigQuery dataset to terraform config
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Mar 5, 2024
1 parent 414699e commit 708b975
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions terraform/bigquery.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
resource "google_bigquery_dataset" "test_dataset" {
dataset_id = "octue_sdk_python_test_dataset"
description = "A dataset for testing BigQuery subscriptions for the Octue SDK."
location = "EU"
default_table_expiration_ms = 3600000

labels = {
env = "default"
}
}

resource "google_bigquery_table" "test_table" {
dataset_id = google_bigquery_dataset.test_dataset.dataset_id
table_id = "question-events"

labels = {
env = "default"
}

schema = <<EOF
[
{
"name": "subscription_name",
"type": "STRING",
"mode": "REQUIRED"
},
{
"name": "message_id",
"type": "STRING",
"mode": "REQUIRED"
},
{
"name": "publish_time",
"type": "TIMESTAMP",
"mode": "REQUIRED"
},
{
"name": "data",
"type": "JSON",
"mode": "REQUIRED",
"description": "Octue service event (e.g. heartbeat, log record, result)."
},
{
"name": "attributes",
"type": "JSON",
"mode": "REQUIRED",
"description": "Metadata for routing the event, adding context, and guiding the receiver's behaviour."
}
]
EOF
}

0 comments on commit 708b975

Please sign in to comment.