Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Commit

Permalink
NON-JIRA: Views for newest SLI snapshot values
Browse files Browse the repository at this point in the history
  • Loading branch information
jarekdrabek committed Nov 14, 2018
1 parent 888c466 commit be98109
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion terraform/SLI_history_dataset.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,30 @@ resource "google_bigquery_table" "SLI_backup_quality_view" {
}

depends_on = ["google_bigquery_table.SLI_backup_quality"]
}
}

resource "google_bigquery_table" "SLI_backup_latency_last_snapshot_value_view" {
project = "${local.SLI_views_destination_project}"
dataset_id = "${var.SLI_history_dataset}"
table_id = "SLI_backup_latency_last_snapshot_value"

view {
query = "SELECT MAX(snapshotTime) FROM [${local.SLI_views_destination_project}:${var.SLI_history_dataset}.SLI_backup_creation_latency] WHERE _PARTITIONTIME=TIMESTAMP(UTC_USEC_TO_DAY(CURRENT_TIMESTAMP()))"
use_legacy_sql = true
}

depends_on = ["google_bigquery_table.SLI_backup_creation_latency"]
}

resource "google_bigquery_table" "SLI_backup_quality_last_snapshot_value_view" {
project = "${local.SLI_views_destination_project}"
dataset_id = "${var.SLI_history_dataset}"
table_id = "SLI_backup_quality_last_snapshot_value"

view {
query = "SELECT MAX(snapshotTime) FROM [${local.SLI_views_destination_project}:${var.SLI_history_dataset}.SLI_backup_quality] WHERE _PARTITIONTIME=TIMESTAMP(UTC_USEC_TO_DAY(CURRENT_TIMESTAMP()))"
use_legacy_sql = true
}

depends_on = ["google_bigquery_table.SLI_backup_quality"]
}

0 comments on commit be98109

Please sign in to comment.