File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,17 @@ resource "aws_rds_cluster_instance" "cluster_instances" {
96
96
engine_version = aws_rds_cluster. this [0 ]. engine_version
97
97
}
98
98
99
+ resource "aws_db_parameter_group" "db_metaflow" {
100
+ name = " ${ var . resource_prefix } ${ var . db_name } -parameters${ var . resource_suffix } "
101
+ family = " postgres11"
102
+
103
+ # long-tail query logging for queries taking > 100 ms
104
+ parameter {
105
+ name = " log_min_duration_statement"
106
+ value = " 100"
107
+ }
108
+ }
109
+
99
110
/*
100
111
Define rds db instance.
101
112
*/
@@ -119,6 +130,16 @@ resource "aws_db_instance" "this" {
119
130
final_snapshot_identifier = " ${ var . resource_prefix } ${ var . db_name } -final-snapshot${ var . resource_suffix } -${ random_pet . final_snapshot_id . id } " # Snapshot upon delete
120
131
vpc_security_group_ids = [aws_security_group . rds_security_group . id ]
121
132
133
+ # enable performance insights for debugging performance issues
134
+ # note: only certain values are allowed for retention_period (check docs),
135
+ # using retention period > 7 days will put us beyond the free tier.
136
+ performance_insights_enabled = true
137
+ performance_insights_retention_period = 7
138
+ # enable long tail query logging and export logs to CW so that they are not
139
+ # deleted on expiry.
140
+ parameter_group_name = aws_db_parameter_group. db_metaflow . name
141
+ enabled_cloudwatch_logs_exports = [" postgresql" ]
142
+
122
143
tags = merge (
123
144
var. standard_tags ,
124
145
{
You can’t perform that action at this time.
0 commit comments