Skip to content

Commit

Permalink
feat: Configure notify-keyspace-events for redis (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
levinandrew authored Nov 27, 2024
1 parent ec0e421 commit e63e89f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/clickhouse/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ resource "google_dns_record_set" "psc_dns_record" {
name = "*.${var.clickhouse_region}.p.gcp.clickhouse.cloud."
managed_zone = google_dns_managed_zone.psc_dns_zone.name
type = "A"
rrdatas = [ google_compute_address.psc_endpoint_ip.address ]
rrdatas = [google_compute_address.psc_endpoint_ip.address]
ttl = 3600
}
4 changes: 2 additions & 2 deletions modules/clickhouse/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ variable "clickhouse_private_endpoint_service_name" {
default = ""

validation {
condition = can(regex("-clickhouse-cloud$", var.clickhouse_private_endpoint_service_name))
condition = can(regex("-clickhouse-cloud$", var.clickhouse_private_endpoint_service_name))
error_message = "ClickHouse Service name must end in '-clickhouse-cloud'."
}
}
Expand All @@ -31,7 +31,7 @@ variable "clickhouse_region" {
default = ""

validation {
condition = length(var.clickhouse_region) > 0
condition = length(var.clickhouse_region) > 0
error_message = "Clickhouse Region should always be set if the private endpoint service name is specified."
}
}
4 changes: 4 additions & 0 deletions modules/redis/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ resource "google_redis_instance" "default" {
auth_enabled = true

labels = var.labels

redis_configs = {
notify-keyspace-events = "K$"
}
}
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ output "sa_account_email" {

output "clickhouse_private_endpoint_id" {
description = "ClickHouse Private endpoint Endpoint ID to secure access inside VPC"
value = var.clickhouse_private_endpoint_service_name != "" ? module.clickhouse[0].psc_connection_id : null
value = var.clickhouse_private_endpoint_service_name != "" ? module.clickhouse[0].psc_connection_id : null
}

0 comments on commit e63e89f

Please sign in to comment.