Prevent data loss for your instance by enabling automated backups

This page describes the Cloud SQL enable automated backups recommender which helps you detect instances which are critical and have a risk of data loss.

The Cloud SQL enable automated backups recommender analyzes instance metadata and recommends to configure automated backups for production instances that have no automated backups enabled.

Recommendations are generated daily.

Pricing

The Cloud SQL enable automated backups recommender is in the Standard Recommender pricing tier.

Before you begin

Before you can view recommendations and insights, do the following:

  • To get the permissions to view and work with insights and recommendations, ensure that you have the required Identity and Access Management (IAM) roles.
    Tasks Roles
    View recommendations One of these roles: recommender.cloudsqlViewer or cloudsql.viewer.
    Apply recommendations One of these roles: recommender.cloudsqlAdmin, cloudsql.editor, or cloudsql.admin.
    For more information about IAM roles, see IAM basic and predefined roles reference and Manage access to projects, folders, and organizations.
  • Enable the Recommender API.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the API

List reliability recommendations for enabling automated backups

You can list the enable automated backups recommendations by using the Google Cloud console, gcloud CLI, or the Recommender API.

Console

To list enable automated backups recommendations using the Google Cloud console, follow these steps:

  1. Go to the Active Assist.

    Go to the Active Assist

    For more information, see Getting started with Recommendation Hub.

  2. In the Increase Cloud SQL instance reliability card, click View all.

  3. Select instances with the Enable automated backups recommendation.

gcloud CLI

To list enable automated backups recommendations using gcloud CLI, run the gcloud recommender recommendations list command as follows:

gcloud recommender recommendations list \
--project=PROJECT_ID \
--location=LOCATION \
--recommender=google.cloudsql.instance.ReliabilityRecommender \
--filter=recommenderSubtype=ENABLE_AUTO_BACKUP

Replace the following:

  • PROJECT_ID: Your project ID.
  • LOCATION: A region where your instances are located, such as us-central1.

API

To list enable automated backups recommendations using the Recommendations API, call the recommendations.list method as follows:

GET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/recommenders/google.cloudsql.instance.ReliabilityRecommender/recommendations

Replace the following:

  • PROJECT_ID: Your project ID.
  • LOCATION: A region where your instances are located, such as us-central1.

If the recommender detects instances for the enable automated backups recommendation, it lists them in a table. Each row shows the instance name, a brief recommendation, the current machine type, the recommended machine type, the location, and the last refresh date.

View insights and detailed recommendations

You can view insights and detailed recommendations about instances that require enabling automated backups using the Google Cloud console, gcloud CLI, or the Recommender API.

Console

To view insights and detailed recommendations about instances that require enabling automated backups, click the recommendation link in the list of instances.

gcloud CLI

To view insights and detailed recommendations about instances that require enabling automated backups, run the gcloud recommender insights list command as follows:

gcloud recommender insights list \
--project=PROJECT-ID \
--location=LOCATION \
--insight-type=google.cloudsql.instance.ReliabilityInsight \
--filter=insightSubtype=CRITICAL_INSTANCE_AUTO_BACKUP_NOT_ENABLED

Replace the following:

  • PROJECT_ID: Your project ID.
  • LOCATION: A region where your instances are located, such as us-central1.

API

To view insights and detailed recommendations about instances that require enabling automated backups, use the Recommendations API, call the insights.list method as follows:

GET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/insightTypes/google.cloudsql.instance.ReliabilityInsight/insights

Replace the following:

  • PROJECT_ID: Your project ID.
  • LOCATION: A region where your instances are located, such as us-central1.

Apply recommendation

To apply this recommendation, do the following:

  • Click Enable automated backups in the Issues column. An Enable automated backups window displays providing a recommendation.
  • Click Edit instance > Data Protection > Automate daily backups to proceed.

    For more information, see Automated backup and transaction log retention.

What's next