Skip to content

Commit 6b928f6

Browse files
feat: Added option to enable insights for replica instances (#230)
1 parent 21d3771 commit 6b928f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

modules/postgresql/read_replica.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ resource "google_sql_database_instance" "replicas" {
5454
}
5555
}
5656
}
57+
dynamic "insights_config" {
58+
for_each = var.insights_config != null ? [var.insights_config] : []
59+
60+
content {
61+
query_insights_enabled = true
62+
query_string_length = lookup(insights_config.value, "query_string_length", 1024)
63+
record_application_tags = lookup(insights_config.value, "record_application_tags", false)
64+
record_client_address = lookup(insights_config.value, "record_client_address", false)
65+
}
66+
}
5767

5868
disk_autoresize = lookup(each.value, "disk_autoresize", var.disk_autoresize)
5969
disk_size = lookup(each.value, "disk_size", var.disk_size)

0 commit comments

Comments
 (0)