

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

# 先決條件
<a name="s3tables-catalog-prerequisites"></a>

在 AWS Glue Data Catalog 中建立 S3 Tables 的聯合型錄之前，請確定您的 IAM 主體 （使用者或角色） 具有必要的許可。

## 所需的 IAM 許可
<a name="s3tables-required-iam-permissions"></a>

您的 IAM 主體需要下列許可才能啟用 S3 Tables 整合：

**AWS Glue 許可**：
+ `glue:CreateCatalog` – `s3tablescatalog` 建立聯合目錄時需要
+ `glue:GetCatalog` – 檢視目錄詳細資訊時需要
+ `glue:GetDatabase` – 將 S3 命名空間檢視為資料庫時需要
+ `glue:GetTable` – 檢視 S3 資料表時需要
+ `glue:passConnection` – 授予呼叫委託人將`aws:s3tables`連線委派給 AWS Glue 服務的權利

**S3 Tables 許可** （用於 IAM 存取控制）：
+ `s3tables:CreateTableBucket`
+ `s3tables:GetTableBucket`
+ `s3tables:CreateNamespace`
+ `s3tables:GetNamespace`
+ `s3tables:ListNamespaces`
+ `s3tables:CreateTable`
+ `s3tables:GetTable`
+ `s3tables:ListTables`
+ `s3tables:UpdateTableMetadataLocation`
+ `s3tables:GetTableMetadataLocation`
+ `s3tables:GetTableData`
+ `s3tables:PutTableData`

## IAM 政策範例
<a name="s3tables-iam-policy-example"></a>

下列 IAM 政策提供在 IAM 模式中啟用 S3 Tables 與 Data Catalog 整合所需的最低許可：

```
{
  "Version": "2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "GlueDataCatalogPermissions",
      "Effect": "Allow",
      "Action": [
        "glue:CreateCatalog",
        "glue:GetCatalog",
        "glue:GetDatabase",
        "glue:GetTable"
      ],
      "Resource": [
        "arn:aws:glue:region:account-id:catalog/s3tablescatalog",
        "arn:aws:glue:region:account-id:database/s3tablescatalog/*/*",
        "arn:aws:glue:region:account-id:table/s3tablescatalog/*/*/*"
      ]
    },
    {
      "Sid": "S3TablesDataAccessPermissions",
      "Effect": "Allow",
      "Action": [
        "s3tables:GetTableBucket",
        "s3tables:GetNamespace",
        "s3tables:GetTable",
        "s3tables:GetTableMetadataLocation",
        "s3tables:GetTableData"
      ],
      "Resource": [
        "arn:aws:s3tables:region:account-id:bucket/*",
        "arn:aws:s3tables:region:account-id:bucket/*/table/*"
      ]
    }
  ]
}
```