cloudsql/BP/2026_002
Cloud SQL instances should have a maintenance window configured.
Product: CloudSQL
Rule class: Best practice, opinionated recommendation
Description
Configure a maintenance window for the primary instance to control when disruptive updates can occur. By setting a maintenance window, it can be ensured that maintenance events happen during a time that is least disruptive to operations.
Instances with the maintenance window set to ‘Any’ can be updated at any time, which might lead to unexpected downtime during peak hours.
Remediation
A maintenance window can be configured for the Cloud SQL instance using the gcloud command-line tool or the Google Cloud Console.
To set a maintenance window (e.g., on Sundays at 4 AM) using gcloud, run:
gcloud sql instances patch INSTANCE_NAME \
--maintenance-window-day=SUN \
--maintenance-window-hour=4
Replace INSTANCE_NAME with the name of the Cloud SQL instance.