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

Support separate insights_config for postgresql read replicas #483

Closed
jawnsy opened this issue Jun 29, 2023 · 0 comments · Fixed by #507
Closed

Support separate insights_config for postgresql read replicas #483

jawnsy opened this issue Jun 29, 2023 · 0 comments · Fixed by #507
Assignees
Labels
enhancement New feature or request

Comments

@jawnsy
Copy link
Contributor

jawnsy commented Jun 29, 2023

TL;DR

The MySQL module allows read replicas to have a separate insights_config, which overrides the default:

insights_config = optional(object({
query_string_length = number
record_application_tags = bool
record_client_address = bool
}))

However, the PostgreSQL module does not:

// Read Replicas
variable "read_replicas" {
description = "List of read replicas to create. Encryption key is required for replica in different region. For replica in same region as master set encryption_key_name = null"
type = list(object({
name = string
name_override = optional(string)
tier = string
availability_type = string
zone = string
disk_type = string
disk_autoresize = bool
disk_autoresize_limit = number
disk_size = string
user_labels = map(string)
database_flags = list(object({
name = string
value = string
}))
ip_configuration = object({
authorized_networks = list(map(string))
ipv4_enabled = bool
private_network = string
require_ssl = bool
allocated_ip_range = string
enable_private_path_for_google_cloud_services = optional(bool)
})
encryption_key_name = string
}))
default = []
}

It's unclear whether this is a limitation of the database type or just the module. The PostgreSQL module seems to inherit the configuration from the primary:

for_each = var.insights_config != null ? [var.insights_config] : []

Whereas the MySQL module uses the replica-specific setting (this should probably inherit settings from the primary, and only override in replicas if set, via the Terraform merge function or similar):

for_each = lookup(each.value, "insights_config") != null ? [lookup(each.value, "insights_config")] : []

Terraform Resources

No response

Detailed design

No response

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants