Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

declare instance name, tier for shard #1148

Merged
merged 1 commit into from
Jun 24, 2024
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
2 changes: 2 additions & 0 deletions terraform/gcp/modules/mysql/mysql.tf
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ resource "google_sql_database_instance" "sigstore" {
}
}

/*
moved {
from = google_sql_database_instance.trillian
to = google_sql_database_instance.sigstore
}
*/

resource "google_sql_database_instance" "read_replica" {
for_each = toset(var.replica_zones)
Expand Down
7 changes: 2 additions & 5 deletions terraform/gcp/modules/sigstore/sigstore.tf
Original file line number Diff line number Diff line change
Expand Up @@ -346,18 +346,15 @@ module "ctlog_shards" {

for_each = var.ctlog_shards

instance_name = format("%s-ctlog-%s", var.cluster_name, each.key)
instance_name = each.value["instance_name"] != "" ? each.value["instance_name"] : format("%s-ctlog-%s", var.cluster_name, each.key)

project_id = var.project_id
region = var.region

cluster_name = var.cluster_name

database_version = each.value["mysql_db_version"]

// NB: This is commented out so that we pick up the defaults
// for the particular environment consistently.
//mysql_tier = var.mysql_tier
tier = each.value["mysql_tier"] != "" ? each.value["mysql_tier"] : var.mysql_tier

replica_zones = var.mysql_replica_zones
replica_tier = var.mysql_replica_tier
Expand Down
2 changes: 2 additions & 0 deletions terraform/gcp/modules/sigstore/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ variable "dns_domain_name" {
variable "ctlog_shards" {
type = map(object({
mysql_db_version = string
mysql_tier = string
instance_name = optional(string)
}))

description = "Map of CTLog shards to create. If keys are '2022' and '2023', it would create 2 independent CTLog Cloud MySql instances named sigstore-staging-ctlog-2022 and sigstore-staging-ctlog-2023."
Expand Down