Other Articles

Cloud SQL – Configure Maintenance Window

Secure Configuration Checks > GCP

This check ensures that Cloud SQL instances have a maintenance window. Updates, including minor version upgrades, are then applied at a time that you plan.

Check Details

  • Resource: Cloud SQL Instance
  • Check: Configure Cloud SQL maintenance window
  • Risk: Without a maintenance window, updates can start at any time. They can cause a short outage during business hours.

Remediation via Google Cloud Console

  1. Log in to the Google Cloud Console and navigate to Cloud SQL. Cloud Sql Instance
  2. Click on the affected Cloud SQL instance.
  3. Click Edit to modify the instance configuration. Cloud Sql Instance Edit
  4. Expand Customize your instance and scroll to the Maintenance section. Cloud SQL Maintenance
  5. Under Maintenance section, select a Maintenance timing and window in a period of low traffic. Cloud SQL Maintenance Window
  6. Click Save to apply the changes.

Remediation via Google Cloud CLI

  1. Open the Google Cloud Console and launch Cloud Shell. GCP Cloud Shell
  2. List the instances that have no maintenance window:

    gcloud sql instances list \
    --filter="NOT settings.maintenanceWindow.day:*" \
    --format="table(name,region)"
    
  3. Set a maintenance window on the Cloud SQL instance:

    gcloud sql instances patch <INSTANCE_NAME> \
    --maintenance-window-day=<DAY> \
    --maintenance-window-hour=<HOUR>
    

    Replace <INSTANCE_NAME> with your Cloud SQL instance name. Replace <DAY> with a day such as SUN. Replace <HOUR> with an hour from 0 to 23, for example 2. The hour is in UTC.

  4. Verify the maintenance window:

    gcloud sql instances describe <INSTANCE_NAME> \
    --format="yaml(settings.maintenanceWindow)"
    

Default Value

By default, no maintenance window is set. Cloud SQL can then start maintenance at any time. Maintenance can cause a short outage.

Updated on 09 November, 2026