このページでは、Dataproc Metastore リソースでタグの適用、削除、一覧取得を行う方法について説明します。Dataproc Metastore のタグの概要については、タグを使用して Dataproc Metastore リソースを整理するをご覧ください。
始める前に
Dataproc Metastore リソースのタグの表示と設定に必要な権限を取得するには、プロジェクトに対する次の IAM ロールを付与するよう管理者に依頼してください。
-
Dataproc Metastore 編集者(
roles/metastore.editor
): タグの設定と表示を割り当てる -
Dataproc Metastore 閲覧者(
roles/metastore.viewer
): タグを表示するユーザーに割り当てます。
ロールの付与については、プロジェクト、フォルダ、組織へのアクセス権の管理をご覧ください。
必要な権限は、カスタムロールや他の事前定義ロールから取得することもできます。
タグを操作する
Resource Manager を使用してタグを作成して定義したら、Dataproc Metastore サービスとフェデレーション リソースでタグの使用を開始できます。タグ バインディングを使用する Google Cloud CLI コマンドの詳細については、gcloud resource-manager tags bindings をご覧ください。
このページのすべてのコマンドで、次のように置き換えます。
PARENT_PATH
: サービスまたはフェデレーション リソースの完全なパス。例://metastore.googleapis.com/projects/my-project/locations/us-central1/services/my-service
。TAG_VALUE
: リソースに適用するタグ値。たとえば、815471563813/environment/development
として設定されたタグ値には、次のコンポーネントが含まれています。815471563813
は、組織 ID またはプロジェクト ID です。environment
はタグキーです。development
はタグ値です。
LOCATION
: サービスまたはフェデレーションが配置されているリージョン(例:us-central1
)。
Dataproc Metastore リソースにタグを適用する
gcloud resource-manager tags bindings create \ --parent=PARENT_PATH \ --tag-value=TAG_VALUE \ --location=LOCATION
Dataproc Metastore リソースからタグを削除する
gcloud resource-manager tags bindings delete \ --parent=PARENT_PATH \ --tag-value=TAG_VALUE \ --location=LOCATION
Dataproc Metastore リソースのタグを一覧表示する
gcloud resource-manager tags bindings list \ --parent=PARENT_PATH \ --location=LOCATION