このページでは、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