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