Skip to content

Commit

Permalink
feat: Added option to enable insights for replica instances (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksaurabhsinha committed Jul 2, 2021
1 parent 21d3771 commit 6b928f6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/postgresql/read_replica.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ resource "google_sql_database_instance" "replicas" {
}
}
}
dynamic "insights_config" {
for_each = var.insights_config != null ? [var.insights_config] : []

content {
query_insights_enabled = true
query_string_length = lookup(insights_config.value, "query_string_length", 1024)
record_application_tags = lookup(insights_config.value, "record_application_tags", false)
record_client_address = lookup(insights_config.value, "record_client_address", false)
}
}

disk_autoresize = lookup(each.value, "disk_autoresize", var.disk_autoresize)
disk_size = lookup(each.value, "disk_size", var.disk_size)
Expand Down

0 comments on commit 6b928f6

Please sign in to comment.