Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,10 @@ dmypy.json

# Troy
scratch.py

# Terraform
.terraform
.terraform.lock.hcl

# Temp files
*+
4 changes: 4 additions & 0 deletions terraform_broker/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module "lsst" {
source = "./modules/lsst"
}

3 changes: 3 additions & 0 deletions terraform_broker/modules/lsst/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# LSST broker and storage

The `lsst` module defines the LSST portion of the Pitt-Google Broker.

Check notice on line 3 in terraform_broker/modules/lsst/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

terraform_broker/modules/lsst/README.md#L3

Files should end with a single newline character
45 changes: 45 additions & 0 deletions terraform_broker/modules/lsst/bigquery.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
resource "google_bigquery_dataset" "dataset" {
dataset_id = "lsst${local.underscored_test_suffix}"
description = "Dataset for storing LSST tables"
location = var.region

labels = {
env = var.prod ? "prod" : "test"
test_suffix = var.prod ? "" : var.test_suffix
}
}

resource "google_bigquery_table" "alerts_table" {
dataset_id = google_bigquery_dataset.dataset.dataset_id
table_id = join("_", ["alerts", replace(var.alerts_schema_version, ".", "_")])
description = "Alert data from LSST. This table is an archive of the lsst-alerts Pub/Sub stream. It has the same schema as the original alert bytes, including nested and repeated fields."

schema = file("${path.module}/bq_schemas/alerts_table.json")

labels = {
versiontag = var.alerts_schema_version
}
}

resource "google_bigquery_table" "supernnova_table" {
dataset_id = google_bigquery_dataset.dataset.dataset_id
table_id = "supernnova"
description = "Binary classification results from SuperNNova."

schema = file("${path.module}/bq_schemas/supernnova_table.json")
}

resource "google_bigquery_table" "variability_table" {
dataset_id = google_bigquery_dataset.dataset.dataset_id
table_id = "variability"

schema = file("${path.module}/bq_schemas/variability_table.json")
}

resource "google_bigquery_table" "upsilon_table" {
dataset_id = google_bigquery_dataset.dataset.dataset_id
table_id = "upsilon"

schema = file("${path.module}/bq_schemas/upsilon_table.json")
}

Loading