

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 新增 S3 on Outposts 儲存貯體的標籤
<a name="S3OutpostsBucketTags"></a>

您可以新增 S3 on Outposts 儲存貯體標籤，以追蹤個別專案或專案群組的儲存成本和其他條件。

**注意**  
建立儲存貯體的 AWS 帳戶 擁有該儲存貯體，且是唯一可以變更其標籤的帳戶。

## 使用 S3 主控台
<a name="s3-outposts-add-bucket-tags"></a>

1. 登入 AWS 管理主控台，並開啟位於 [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/) 的 Amazon S3 主控台。

1. 在左側導覽窗格中，選擇 **Outposts buckets** (Outposts 儲存貯體)。

1. 選擇包含您要編輯其標籤的 Outposts 儲存貯體。

1. 選擇**屬性**索引標籤。

1. 在 **Tags (標籤)** 下方，選擇 **Edit (編輯)**。

1. 選擇 **Add new tag** (新增標籤)，然後輸入 **金鑰**和選項**值**。

   新增要與 Outposts 儲存貯體關聯的任何標籤，以追蹤個別專案或專案群組的條件。

1. 選擇 **Save changes** (儲存變更)。

## 使用 AWS CLI
<a name="S3OutpostsBucketTagsCLI"></a>

下列 AWS CLI 範例使用目前檔案夾中指定標籤 (`tagging.json`) 的 JSON 文件，將標籤組態套用於 S3 on Outposts 儲存貯體上。若要使用此範例，請以您自己的資訊取代每個 `user input placeholder`。

```
aws s3control put-bucket-tagging --account-id 123456789012 --bucket arn:aws:s3-outposts:region:123456789012:outpost/op-01ac5d28a6a232904/bucket/example-outposts-bucket --tagging file://tagging.json

tagging.json

{
   "TagSet": [
     {
       "Key": "organization",
       "Value": "marketing"
     }
   ]
}
```

下列 AWS CLI 範例直接從命令列將標籤組態應用於 S3 on Outposts 儲存貯體上。

```
aws s3control put-bucket-tagging --account-id 123456789012 --bucket arn:aws:s3-outposts:region:123456789012:outpost/op-01ac5d28a6a232904/bucket/example-outposts-bucket --tagging 'TagSet=[{Key=organization,Value=marketing}]'
```

如需此命令的詳細資訊，請參閱 *AWS CLI 參考*中的 [put-bucket-tagging](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3control/put-bucket-tagging.html)。