クラウドの非推奨と破壊的変更に関する一般的な Recommender
Cloud の非推奨と破壊的変更に関する一般的な Recommenderでは、Cloud の非推奨と破壊的変更に関する推奨事項が提示されます。今後の非推奨と破壊的変更の影響を受ける Cloud リソースが特定され、それらを管理するためのガイドラインが示されます。推奨事項は、Google Cloud CLI、API、BigQuery へのエクスポートを通じて確認できます。
始める前に
- アカウントにログインします。 Google Cloud を初めて使用する場合は、 アカウントを作成して、実際のシナリオで Google プロダクトのパフォーマンスを評価してください。 Google Cloud新規のお客様には、ワークロードの実行、テスト、デプロイができる無料クレジット $300 分を差し上げます。
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Recommender API.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. 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.-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Recommender API.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. 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.
- 以下のロールがあることを確認してください。
| 説明 | ロール |
|---|---|
| レコメンデーションを表示 |
recommender.cloudDeprecationRecommendationViewer
|
| 推奨事項の表示と更新 |
recommender.cloudDeprecationRecommendationAdmin
|
必要なロール
このセクションでは、クラウドの非推奨と破壊的変更に関する全般的な推奨事項を使用するためのロールと必要な権限について説明します。
| ロール | 含まれる権限 |
|---|---|
| roles/recommender.cloudDeprecationRecommendationViewer |
|
| roles/recommender.cloudDeprecationRecommendationAdmin |
|
ロールとアクセス権の付与の詳細については、以下をご覧ください。
料金
クラウドの非推奨と破壊的変更に関する一般的な推奨事項は無料です。他の料金ティアの詳細については、Recommender の料金をご覧ください。
クラウドの非推奨に関する推奨事項を確認する
コンソール、Google Cloud CLI、Recommender API、または BigQuery エクスポートを使用して、推奨事項のリストを取得できます。
コンソール
[Active Assist] に移動します。
[フィルタ] フィールドを
Recommender:google.cloud.deprecation.GeneralRecommenderに設定します。
Google Cloud CLI
このタブでは、Google Cloud CLI を使用して推奨事項と分析情報のリストを取得するコマンドを示します。
推奨事項の一覧表示
gcloud recommender recommendations list \ --billing-project=BILLING_PROJECT_ID \ --project=PROJECT_ID \ --location=LOCATION \ --recommender=google.cloud.deprecation.GeneralRecommender \ --format=yaml分析情報のリストを取得する
gcloud recommender insights list \ --billing-project=BILLING_PROJECT_ID \ --project=PROJECT_ID \ --location=LOCATION \ --insight-type=google.cloud.deprecation.GeneralInsight \ --format=yaml
次のように置き換えます。
- BILLING_PROJECT_ID は、Recommender API を有効にしたプロジェクトの ID に置き換えます。
- PROJECT_ID は、 プロジェクトの識別子に置き換えます。 Google Cloud
- LOCATION は、推奨事項に関連付けられているリソースがある Google Cloud ロケーション(global、 us-central1-a など)に置き換えます。
API
このタブでは、Recommender API を使用して推奨事項と分析情報のリストを取得するコマンドを示します。
推奨事項の一覧表示
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"分析情報のリストを取得する
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"
次のように置き換えます。
- BILLING_PROJECT_ID は、Recommender API を有効にしたプロジェクトの ID に置き換えます。
- PROJECT_ID は、 プロジェクトの識別子に置き換えます。 Google Cloud
- LOCATION は、推奨事項に関連付けられているリソースがある Google Cloud ロケーション(global、 us-central1-a など)に置き換えます。
BigQuery Export
このタブでは、BigQuery へのエクスポートを使用して推奨事項と分析情報のリストを取得するコマンドを示します。
BigQuery へのエクスポートには、クラウドの非推奨に関する推奨事項も含まれています。BigQuery へのエクスポートでは、組織に対する推奨事項の日次スナップショットを表示できます。
BigQuery へのエクスポートに関するドキュメントに従って、推奨事項を BigQuery にエクスポートします。
すべての非推奨に関する推奨事項をクエリします。
SELECT * FROM `<project>.<dataset>.recommendations_export` WHERE DATE(_PARTITIONTIME) = "<date>" and recommender = "google.cloud.deprecation.GeneralRecommender"
利用可能な推奨事項のサブタイプ
次の表に、利用可能であり開示可能な推奨事項のサブタイプを示します。
| サブタイプ | 非推奨または破壊的変更 |
|---|---|
| GCE_METADATA_SERVER_HEADER_WHITESPACE | Compute Engine では、Compute Engine メタデータ サービスで RFC 7230 のセクション 3.2 に沿って HTTP リクエスト フォーマット チェックを適用します。フォーマットが正しくないリクエストを受け入れると、セキュリティの脆弱性につながる可能性があります。 |
この表は包括的なものではなく、セキュリティ関連の非推奨や破壊的変更は意図的に省略されている場合があります。