

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

# 使用標籤建立資料表
<a name="table-create-tag"></a>

您可以在建立 Amazon S3 資料表時為其加上標籤。在超過標準 S3 API 請求率的資料表上使用標籤不會產生額外費用。如需詳細資訊，請參閱 [Simple Storage Service (Amazon S3) 定價](https://aws.amazon.com/s3/pricing/)。如需標記資料表的詳細資訊，請參閱 [搭配 S3 資料表使用標籤](table-tagging.md)。

## 許可
<a name="table-create-tag-permissions"></a>

若要建立具有標籤的資料表，您必須具有下列許可：
+ `s3tables:CreateTable`
+ `s3tables:TagResource`

## 故障診斷錯誤
<a name="table-create-tag-troubleshooting"></a>

如果您在嘗試建立具有標籤的資料表時遇到錯誤，您可以執行下列動作：
+ 確認您擁有[許可](#table-create-tag-permissions)建立資料表並對其套用標籤所需的 。
+ 檢查您的 IAM 使用者政策是否具備任何屬性型存取控制 (ABAC) 條件。您的政策可能會要求您只使用特定的標籤索引鍵和值來標記資料表。如需 ABAC 和範例資料表 ABAC 政策的詳細資訊，請參閱適用於 [ S3 資料表的 ABAC](https://docs.aws.amazon.com/AmazonS3/latest/userguide/table-tagging.html#abac-for-tables)。

## 步驟
<a name="table-create-tag-steps"></a>

您可以使用 AWS Command Line Interface (AWS CLI)、Amazon S3 Tables REST API 和 AWS SDKs 建立具有套用標籤的資料表。

## 使用 REST API
<a name="table-create-tag-api"></a>

如需建立具有標籤之資料表的 Amazon S3 Tables REST API 支援的相關資訊，請參閱《*Amazon Simple Storage Service API 參考*》中的下列章節：
+ [CreateTable](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3Buckets_CreateTable.html)

## 使用 AWS CLI
<a name="table-create-tag-cli"></a>

若要安裝 AWS CLI，請參閱《 [AWS 使用者指南》中的安裝 CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)。 *AWS Command Line Interface *

下列 CLI 範例說明如何使用 建立具有標籤的資料表 AWS CLI。若要使用此命令，請以您自己的資訊取代*使用者輸入預留位置*。

建立資料表時，您必須提供組態詳細資訊。如需詳細資訊，請參閱[建立 Amazon S3 資料表](s3-tables-create.md)。您也必須使用遵循資料表命名慣例的名稱來命名資料表。如需更多資訊，請參閱[Amazon S3 資料表儲存貯體、資料表和命名空間命名規則](s3-tables-buckets-naming.md)。

**要求:**

```
aws --region us-west-2 \
s3tables create-table \
--endpoint https://ufwae60e2k.execute-api.us-west-2.amazonaws.com/personal/ \
--table-bucket-arn arn:aws:s3tables:us-west-2:111122223333:bucket/amzn-s3-demo-table-bucket
--tags '{"Department":"Engineering"}' \
--name my_table_abc \
--namespace my_namesapce_123a \
--format ICEBERG
```