compliance.tf

Cloud SQL PostgreSQL instances should have 'log_duration' set to 'on'

Validates that the `log_duration` setting is on, which causes the duration of each completed statement to be logged. Unlike the `log_min_duration_statement` flag, this setting does not log the text of the query itself.

What this control checks

Cloud SQL PostgreSQL instances must have the log_duration database flag set to on.

Framework mappings

The clauses this control is mapped to in each framework.

CIS GCP Benchmark v1.2.0

  • 6.2.5 Ensure 'log_duration' database flag for Cloud SQL PostgreSQL instance is set to 'on'

Tool mappings

Use these identifiers to cross-reference this control across tools, reports, and evidence.

  • Compliance.tf Control: sql_instance_postgresql_log_duration_database_flag_on
  • Checkov Check: CKV2_GCP_13
  • Powerpipe Control: gcp_compliance.control.sql_instance_postgresql_log_duration_database_flag_on

Last reviewed: 2026-10-10

View all Google Cloud controls →

On this page

Ask AI about this

Help improve this page