Other Articles

Cloud SQL – Enable Deletion Protection

This check ensures that deletion protection is enabled for Cloud SQL instances. Deletion protection helps prevent accidental or unauthorized deletion of critical database resources.

Check Details

  • Resource: Cloud SQL
  • Check: Enable deletion protection
  • Risk: If deletion protection is not enabled, Cloud SQL instances may be accidentally or maliciously deleted, resulting in permanent data loss and service disruption.

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. Scroll to the Data protection or Instance settings section.
  5. Enable Deletion protection. Cloud SQL Instance Deletion
  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. Enable deletion protection for a Cloud SQL instance:
    
    
    gcloud sql instances patch <INSTANCE_NAME> \
    --deletion-protection
    

Replace <INSTANCE_NAME> with the name of the Cloud SQL instance you want to protect from accidental deletion.

Default Value

By default, deletion protection is disabled for Cloud SQL instances. Instances can be deleted without additional safeguards unless deletion protection is explicitly enabled.