Ensure Cloud SQL database instances have backup configuration enabled

Error: Cloud SQL database instances do not have backup configuration enabled

Bridgecrew Policy ID: BC_GCP_GENERAL_6
Checkov Check ID: CKV_GCP_14
Severity: HIGH

Cloud SQL database instances do not have backup configuration enabled

Description

Cloud SQL is a fully managed relational database service for MySQL, PostgreSQL and SQL Server. It offers data encryption at rest and in transit, Private connectivity with VPC and user-controlled network access with firewall protection. Backups provide a way to restore a Cloud SQL instance to recover lost data or recover from a problem with your instance.

We recommend you enable automated backups for instances that contain data of high importance.

resource "google_sql_database_instance" "main" {
  name             = "main-instance"
  database_version = "POSTGRES_14"
  region           = "us-central1"
  settings {
    backup_configuration {
        enabled = True
    }
  }
}