Pattern: Missing error logging for Google PostgreSQL
Issue: -
Setting the minimum log severity too high will cause errors not to be logged
Resolution: Set the minimum log severity to at least ERROR
.
Example of incorrect code:
resource "google_sql_database_instance" "db" {
name = "db"
database_version = "POSTGRES_12"
region = "us-central1"
settings {
database_flags {
name = "log_min_messages"
value = "PANIC"
}
}
}
Example of correct code:
resource "google_sql_database_instance" "db" {
name = "db"
database_version = "POSTGRES_12"
region = "us-central1"
settings {
database_flags {
name = "log_min_messages"
value = "WARNING"
}
}
}