

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# 動作グラフのタグの管理
<a name="graph-tags"></a>

タグは、特定のタイプの Detective AWS リソースなど、リソースを定義して割り当てることができるオプションのラベルです。タグを使用することで、目的、所有者、環境、その他の条件など、さまざまな方法でリソースを特定、分類および管理できます。例えば、タグを使用してポリシーを適用したり、コストを割り当てたり、リソースのバージョンを区別したり、特定のコンプライアンス要件やワークフローをサポートするリソースの識別を行うことができます。

動作グラフにタグを割り当てることができます。その後、IAMポリシーのタグ値を使用して、Detective の動作グラフ関数へのアクセスを管理できます。「[Detective の動作グラフのタグに基づく承認](security_iam_service-with-iam.md#security_iam_service-with-iam-tags)」を参照してください。

また、タグをコストレポートのためのツールとして使用することもできます。例えば、セキュリティに関連するコストを追跡するために、Detective の動作グラフ、 AWS Security Hub CSPM ハブリソース、Amazon GuardDuty ディテクターに同じタグを割り当てることができます。では AWS Cost Explorer、そのタグを検索して、それらのリソース全体のコストの統合ビューを表示できます。

## 動作グラフのタグの表示
<a name="graph-tags-list"></a>

動作グラフのタグは、[**General**] (全般) ページから管理します。

------
#### [ Console ]

**動作グラフに割り当てられているタグを表示するには**

1. [https://console.aws.amazon.com/detective/](https://console.aws.amazon.com/detective/) で Amazon Detective コンソールを開きます。

1. ナビゲーションペインで [**Settings**] の [**General**] を選択します。

------
#### [ Detective API, AWS CLI ]

Detective APIまたは を使用して、動作グラフのタグのリスト AWS Command Line Interface を取得できます。

**動作グラフのタグのリストを取得するには (Detective API、 AWS CLI）**
+ **Detective API：** [https://docs.aws.amazon.com/detective/latest/APIReference/API_ListTagsForResource.html](https://docs.aws.amazon.com/detective/latest/APIReference/API_ListTagsForResource.html)オペレーションを使用します。動作グラフARNの を指定する必要があります。
+ **AWS CLI:** コマンドラインで `list-tags-for-resource` コマンドを実行します。

  ```
  aws detective list-tags-for-resource --resource-arn <behavior graph ARN>
  ```

  **例**

  ```
  aws detective list-tags-for-resource --resource-arn arn:aws:detective:us-east-1:111122223333:graph:123412341234
  ```

------

## 動作グラフへのタグの追加
<a name="graph-tags-add"></a>

------
#### [ Console ]

[**General**] (全般) ページのタグリストから、動作グラフにタグ値を追加できます。

**動作グラフにタグを追加するには**

1. **[新しいタグを追加]** をクリックします。

1. [**Key**] (キー) で、タグの名前を入力します。

1. [**Value**] (値) で、タグの値を入力します。

------
#### [ Detective API, AWS CLI ]

Detective APIまたは を使用して AWS CLI 、動作グラフにタグ値を追加できます。

**動作グラフにタグを追加するには (Detective API、 AWS CLI）**
+ **Detective API：** [https://docs.aws.amazon.com/detective/latest/APIReference/API_TagResource.html](https://docs.aws.amazon.com/detective/latest/APIReference/API_TagResource.html)オペレーションを使用します。動作グラフARNと追加するタグ値を指定します。
+ **AWS CLI**: コマンドラインで、`tag-resource` コマンドを実行します。

  ```
  aws-detective tag-resource --aws detective tag-resource --resource-arn <behavior graph ARN> --tags '{"TagName":"TagValue"}'
  ```

  **例**

  ```
  aws detective tag-resource --resource-arn arn:aws:detective:us-east-1:111122223333:graph:123412341234 --tags '{"Department":"Finance"}'
  ```

------

## 動作グラフからのタグの削除
<a name="graph-tags-remove"></a>

------
#### [ Console ]

[**General**] (全般) ページのリストからタグを削除するには、そのタグの [**Remove**] (削除) オプションを選択します。

------
#### [ Detective API, AWS CLI ]

Detective APIまたは を使用して AWS CLI 、動作グラフからタグ値を削除できます。

**動作グラフからタグを削除するには (Detective API、 AWS CLI）**
+ **Detective API：** [https://docs.aws.amazon.com/detective/latest/APIReference/API_UntagResource.html](https://docs.aws.amazon.com/detective/latest/APIReference/API_UntagResource.html)オペレーションを使用します。動作グラフ とARN、削除するタグの名前を指定します。
+ **AWS CLI**: コマンドラインで、`untag-resource` コマンドを実行します。

  ```
  aws detective untag-resource --resource-arn <behavior graph ARN> --tag-keys "TagName"
  ```

  **例**

  ```
  aws detective untag-resource --resource-arn arn:aws:detective:us-east-1:111122223333:graph:123412341234 --tag-keys "Department"
  ```

------