Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ locals {
gcs_use_grpc = true
garbage_collection_interval = "10s"
extra_tesseract_flags = []
log_db_name_override = "${local.base_name}-db"
antispam_db_name_override = "${local.base_name}-antispam-db"
}

include "root" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ locals {
gcs_use_grpc = true
garbage_collection_interval = "10s"
extra_tesseract_flags = []
log_db_name_override = "${local.base_name}-db"
antispam_db_name_override = "${local.base_name}-antispam-db"
}

include "root" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ locals {
gcs_use_grpc = true
garbage_collection_interval = "10s"
extra_tesseract_flags = []
log_db_name_override = "${local.base_name}-db"
antispam_db_name_override = "${local.base_name}-antispam-db"
}

include "root" {
Expand Down
4 changes: 2 additions & 2 deletions deployment/modules/gcp/storage/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ resource "google_spanner_instance" "log_spanner" {

resource "google_spanner_database" "log_db" {
instance = google_spanner_instance.log_spanner.name
name = "${var.base_name}-db"
name = coalesce(var.log_db_name_override, "${var.base_name}-log")
ddl = [
"CREATE TABLE IF NOT EXISTS Tessera (id INT64 NOT NULL, compatibilityVersion INT64 NOT NULL) PRIMARY KEY (id)",
"CREATE TABLE IF NOT EXISTS SeqCoord (id INT64 NOT NULL, next INT64 NOT NULL,) PRIMARY KEY (id)",
Expand All @@ -79,7 +79,7 @@ resource "google_spanner_database" "log_db" {

resource "google_spanner_database" "antispam_db" {
instance = google_spanner_instance.log_spanner.name
name = "${var.base_name}-antispam-db"
name = coalesce(var.antispam_db_name_override, "${var.base_name}-aspam")
ddl = [
"CREATE TABLE IF NOT EXISTS FollowCoord (id INT64 NOT NULL, nextIdx INT64 NOT NULL) PRIMARY KEY (id)",
"CREATE TABLE IF NOT EXISTS IDSeq (h BYTES(32) NOT NULL, idx INT64 NOT NULL) PRIMARY KEY (h)",
Expand Down
12 changes: 12 additions & 0 deletions deployment/modules/gcp/storage/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,15 @@ variable "public_bucket" {
type = bool
default = false
}

variable "log_db_name_override" {
description = "Optional. Name of the Spanner DB to use for the log, overriding the default name format. This variable is optional and should only be used for legacy compatibility."
type = string
default = null
}

variable "antispam_db_name_override" {
description = "Optional. Name of the Spanner DB to use for the antispam deduplication, overriding the default name format. This variable is optional and should only be used for legacy compatibility."
type = string
default = null
}
3 changes: 3 additions & 0 deletions deployment/modules/gcp/tesseract/gce/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ module "storage" {
ephemeral = var.ephemeral
spanner_pu = var.spanner_pu
public_bucket = var.public_bucket

log_db_name_override = var.log_db_name_override
antispam_db_name_override = var.antispam_db_name_override
}

module "gce" {
Expand Down
12 changes: 12 additions & 0 deletions deployment/modules/gcp/tesseract/gce/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,15 @@ variable "extra_tesseract_flags" {
default = []
}

variable "log_db_name_override" {
description = "Optional. Name of the Spanner DB to use for the log, overriding the default name format. This variable is optional and should only be used for legacy compatibility."
type = string
default = null
}

variable "antispam_db_name_override" {
description = "Optional. Name of the Spanner DB to use for the antispam deduplication, overriding the default name format. This variable is optional and should only be used for legacy compatibility."
type = string
default = null
}

Loading