mirror of
https://github.com/imjasonh/rekor-bq
synced 2026-07-07 00:12:20 +00:00
- BigQuery dataset and tables for storing Rekor entries
- PubSub subscription to Rekor's public topic (project-rekor/new-entry)
- Dead letter topic for failed messages
- IAM permissions for PubSub service account
- Monitoring alerts and dashboard
- SQL view for parsing CloudEvents attributes
- Auto-discovery of project number using data source
- Comprehensive README with setup instructions
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
93 lines
No EOL
2.1 KiB
HCL
93 lines
No EOL
2.1 KiB
HCL
resource "google_bigquery_dataset" "rekor_stream" {
|
|
dataset_id = "rekor_stream"
|
|
friendly_name = "Rekor Transparency Log Stream"
|
|
description = "Streaming data from Sigstore Rekor transparency log"
|
|
location = var.dataset_location
|
|
delete_contents_on_destroy = false
|
|
|
|
lifecycle {
|
|
prevent_destroy = true
|
|
}
|
|
}
|
|
|
|
resource "google_bigquery_table" "entries" {
|
|
dataset_id = google_bigquery_dataset.rekor_stream.dataset_id
|
|
table_id = "entries"
|
|
|
|
time_partitioning {
|
|
type = "DAY"
|
|
field = "publish_time"
|
|
}
|
|
|
|
clustering = ["subscription_name"]
|
|
|
|
schema = jsonencode([
|
|
{
|
|
name = "subscription_name"
|
|
type = "STRING"
|
|
mode = "NULLABLE"
|
|
description = "Subscription that delivered this message"
|
|
},
|
|
{
|
|
name = "message_id"
|
|
type = "STRING"
|
|
mode = "NULLABLE"
|
|
description = "PubSub message ID"
|
|
},
|
|
{
|
|
name = "publish_time"
|
|
type = "TIMESTAMP"
|
|
mode = "NULLABLE"
|
|
description = "PubSub publish time"
|
|
},
|
|
{
|
|
name = "data"
|
|
type = "BYTES"
|
|
mode = "NULLABLE"
|
|
description = "TransparencyLogEntry protobuf (base64)"
|
|
},
|
|
{
|
|
name = "attributes"
|
|
type = "STRING"
|
|
mode = "NULLABLE"
|
|
description = "CloudEvents attributes as JSON string"
|
|
}
|
|
])
|
|
|
|
lifecycle {
|
|
prevent_destroy = true
|
|
}
|
|
}
|
|
|
|
resource "google_bigquery_table" "entries_dead_letter" {
|
|
dataset_id = google_bigquery_dataset.rekor_stream.dataset_id
|
|
table_id = "entries_dead_letter"
|
|
|
|
schema = jsonencode([
|
|
{
|
|
name = "subscription_name"
|
|
type = "STRING"
|
|
mode = "NULLABLE"
|
|
},
|
|
{
|
|
name = "message_id"
|
|
type = "STRING"
|
|
mode = "NULLABLE"
|
|
},
|
|
{
|
|
name = "publish_time"
|
|
type = "TIMESTAMP"
|
|
mode = "NULLABLE"
|
|
},
|
|
{
|
|
name = "data"
|
|
type = "STRING"
|
|
mode = "NULLABLE"
|
|
},
|
|
{
|
|
name = "attributes"
|
|
type = "STRING"
|
|
mode = "NULLABLE"
|
|
}
|
|
])
|
|
} |