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

Add support for specifying a different mysql version for each ctlog shard #855

Merged
merged 2 commits into from
Nov 14, 2023
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
8 changes: 5 additions & 3 deletions terraform/gcp/modules/sigstore/sigstore.tf
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,19 @@ module "ctlog" {
module "ctlog_shards" {
source = "../mysql-shard"

for_each = toset(var.ctlog_shards)
for_each = var.ctlog_shards

instance_name = format("%s-ctlog-%s", var.cluster_name, each.key)

project_id = var.project_id
region = var.region

cluster_name = var.cluster_name
// NB: These are commented out so that we pick up the defaults

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_database_version = var.mysql_db_version
//mysql_tier = var.mysql_tier

replica_zones = var.mysql_replica_zones
Expand Down
9 changes: 6 additions & 3 deletions terraform/gcp/modules/sigstore/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,12 @@ variable "dns_domain_name" {
}

variable "ctlog_shards" {
type = list(string)
description = "Array of CTLog shards to create. Entry should be something like [2021, 2022], which would then have 2 independent CTLog shards backed by ctlog-2021 and ctlog-2022 Cloud SQL instances."
default = []
type = map(object({
mysql_db_version = 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."
default = {}
}

variable "standalone_mysqls" {
Expand Down