Skip to content

Commit

Permalink
Add support for specifying a different mysql version for each ctlog s…
Browse files Browse the repository at this point in the history
…hard (#855)

* add support for specifying a different mysql version for each ctlog shard

Signed-off-by: Priya Wadhwa <[email protected]>

* move comment

Signed-off-by: Priya Wadhwa <[email protected]>

---------

Signed-off-by: Priya Wadhwa <[email protected]>
  • Loading branch information
priyawadhwa authored Nov 14, 2023
1 parent 0ce8a13 commit 55c9f48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
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

0 comments on commit 55c9f48

Please sign in to comment.