# Cloud deprecation and breaking changes general recommender

> [!WARNING]
>
> **Preview**
>
>
> This feature is
>
> subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the
> [Service Specific
> Terms](https://docs.cloud.google.com/terms/service-terms#1).
>
> Pre-GA features are available "as is" and might have limited support.
>
> For more information, see the
> [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages).

**Cloud deprecation and breaking changes general recommender** provides you with
recommendations about Cloud deprecations and breaking changes. It identifies
Cloud resources that will be affected by upcoming deprecations and breaking
changes while providing guidelines on how to manage them. Recommendations
are viewable through Google Cloud CLI, the API, and BigQuery export.

## Before you begin

> [!NOTE]
> **Note:** You only need to enable the API on a single billing project. You can then use this same billing project to retrieve recommendations and insights for other projects, the entire organization or the billing account, using the [`--billing-project` flag](https://docs.cloud.google.com/sdk/gcloud/reference.md.txt#--billing-project).

4. Ensure that you have the following roles:

| Description | Roles |
|---|---|
| View recommendations | `recommender.cloudDeprecationRecommendationViewer` |
| View and update recommendations | `recommender.cloudDeprecationRecommendationAdmin` |

### Required roles

This section describes the roles and necessary permissions to use
the **Cloud deprecation and breaking changes general recommender**.

| Role | Included permissions |
|---|---|
| roles/recommender.cloudDeprecationRecommendationViewer | - `recommender.cloudDeprecationGeneralInsights.get` - `recommender.cloudDeprecationGeneralInsights.list` - `recommender.cloudDeprecationGeneralRecommendations.get` - `recommender.cloudDeprecationGeneralRecommendations.list` |
| roles/recommender.cloudDeprecationRecommendationAdmin | - `recommender.cloudDeprecationGeneralInsights.update` - `recommender.cloudDeprecationGeneralRecommendations.update` |

For more information about roles and about granting access, see the following:

- [Understanding roles](https://docs.cloud.google.com/iam/docs/understanding-roles)
- [Managing access to projects, folders, and organizations](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access.md.txt)

## Pricing

**Cloud deprecation and breaking changes general recommender** is offered at no
charge. For information about other pricing tiers, see
[Recommender pricing](https://cloud.google.com/recommender/pricing).

## View cloud deprecation recommendations

You can list recommendations by using the Console, the Google Cloud CLI, the
Recommender API, or through BigQuery export.

### Console

1. Go to the **Active Assist**.

   [Go to the Active Assist](https://console.cloud.google.com/active-assist/list/manageability/recommendations?pageState=(%22AaRecommendationTable%22:(%22f%22:%22%255B%255D%22)))
2. Set the **Filter field** to `Recommender:google.cloud.deprecation.GeneralRecommender`.

   > [!NOTE]
   > **Note:** You must have the have the correct IAM permissions (listed above) in order to see recommendations. If you have the correct permissions and the page does not show any recommendations, then the project does not have any deprecations or breaking changes that meet the criteria for a recommendation.

### Google Cloud CLI

This tab shows the commands to list recommendations and insights with
Google Cloud CLI.

- List recommendations

  ```bash
  gcloud recommender recommendations list \
    --billing-project=BILLING_PROJECT_ID \
    --project=PROJECT_ID \
    --location=LOCATION \
    --recommender=google.cloud.deprecation.GeneralRecommender \
    --format=yaml
  ```
- List Insights

  ```bash
  gcloud recommender insights list \
    --billing-project=BILLING_PROJECT_ID \
    --project=PROJECT_ID \
    --location=LOCATION \
    --insight-type=google.cloud.deprecation.GeneralInsight \
    --format=yaml
  ```

Replace the following:

- <var translate="no">BILLING_PROJECT_ID</var> with ID of the project that you've enabled with the Recommender API.
- <var translate="no">PROJECT_ID</var> with the identifier for your Google Cloud project.
- <var translate="no">LOCATION</var> with the Google Cloud location where resources associated with the recommendations are located (for example, global or us-central1-a).

### API

This tabs shows your the commands to list recommendations and insights with
the Recommender API.

- List Recommendations

  ```bash
  curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "x-goog-user-project: BILLING_PROJECT_ID" \
    "https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloud.deprecation.GeneralRecommender/recommendations"
  ```
- List Insights

  ```bash
  curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "x-goog-user-project: BILLING_PROJECT_ID" \
    "https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloud.deprecation.GeneralInsight/insights"
  ```

Replace the following:

- <var translate="no">BILLING_PROJECT_ID</var> with ID of the project that you've enabled with the Recommender API.
- <var translate="no">PROJECT_ID</var> with the identifier for your Google Cloud project.
- <var translate="no">LOCATION</var> with the Google Cloud location where resources associated with the recommendations are located (for example, global or us-central1-a).

### BigQuery export

This tab shows the commands to list recommendations with BigQuery
export.

Cloud deprecation recommendations are also included in
[BigQuery export](https://docs.cloud.google.com/recommender/docs/bq-export/export-recommendations-to-bq.md.txt).
With the BigQuery export, you can view daily snapshots of recommendations
for your organization.

1. Follow the [BigQuery export documentation](https://docs.cloud.google.com/recommender/docs/bq-export/export-recommendations-to-bq.md.txt)
   to export recommendations to BigQuery.

2. Query all deprecation recommendations:

   ```bash
   SELECT *
   FROM `<project>.<dataset>.recommendations_export`
   WHERE DATE(_PARTITIONTIME) = "<date>"
   and recommender = "google.cloud.deprecation.GeneralRecommender"
   ```

## Available recommendation subtypes

The following table describes the available and disclosable recommendation
subtypes.

| Subtype | Deprecation or breaking change? |
|---|---|
| GCE_METADATA_SERVER_HEADER_WHITESPACE | Compute Engine will enforce HTTP request formatting checks in the Compute Engine Metadata Service to align with [RFC 7230 Section 3.2](https://notifications.google.com/g/proof/p/ACUgQrFssFgdw4g2yK_7w7qobXnvLrQZOs89s_ihubt3tSBi1OMNl5EJps2mShFQrZ-BwZrhY1l9bnzTv0-Ygnv6Dltvq1V88-nyIQysUeTTX8CinzMuiE81iXEiAiuX-uNp13At7NKmFwgL4H6VfsrnycFOpI_UQuiIk_ljFAVSqeVxJ4YDNfRGrg-52-qHzzROdKQGQm2J_-Ip_4O8Lj6HURq1cgrFjUXeog), as accepting incorrectly formatted requests might lead to security vulnerabilities. |

> [!WARNING]
> **Warning:** Dismissed recommendations are not regenerated and will hide the deprecation recommendation for the instance on all surfaces. Instead, mark it as succeeded once you've applied the recommendation.

Note that this table is not comprehensive and may intentionally omit
security-sensitive deprecations or breaking changes.