

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

# 將 Amazon S3 資料表目錄與 Data Catalog 和 Lake Formation 整合的先決條件
<a name="s3tables-catalog-prerequisites"></a>

以下是啟用 Amazon S3 資料表與 AWS Glue Data Catalog 和 整合的先決條件 AWS Lake Formation。

1.  當您啟用 Amazon S3 資料表整合時，Lake Formation 會自動註冊 S3 資料表的位置。若要向 Lake Formation 註冊資料表儲存貯體位置，您需要具有 `lakeformation:RegisterResource`、 `lakeformation:RegisterResourceWithPrivilegedAccess`和 `lakeformation:CreateCatalog`許可的 IAM 角色/使用者。當具有這些許可的非管理員使用者註冊目錄位置時，Lake Formation 會自動授予他們該位置的`DATA_LOCATION_ACCESS`許可，允許呼叫委託人在已註冊的資料位置上執行所有支援的 Lake Formation 操作。

1. <a name="step3-permissions"></a> 當您啟用 S3 資料表整合時，您需要為 Lake Formation 選擇 IAM 角色來提供登入資料，以允許資料存取。為對 S3 資料表儲存貯體的 Lake Formation 資料存取建立 IAM 角色。向 Lake Formation 註冊資料表儲存貯體時使用的 IAM 角色需要下列許可：

------
#### [ JSON ]

****  

   ```
   {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
           {
               "Sid": "LakeFormationPermissionsForS3ListTableBucket",
               "Effect": "Allow",
               "Action": [
                   "s3tables:ListTableBuckets"
               ],
               "Resource": [
                   "*"
               ]
           },
           {
               "Sid": "LakeFormationDataAccessPermissionsForS3TableBucket",
               "Effect": "Allow",
               "Action": [
                   "s3tables:CreateTableBucket",
                   "s3tables:GetTableBucket",
                   "s3tables:CreateNamespace",
                   "s3tables:GetNamespace",
                   "s3tables:ListNamespaces",
                   "s3tables:DeleteNamespace",
                   "s3tables:DeleteTableBucket",
                   "s3tables:CreateTable",
                   "s3tables:DeleteTable",
                   "s3tables:GetTable",
                   "s3tables:ListTables",
                   "s3tables:RenameTable",
                   "s3tables:UpdateTableMetadataLocation",
                   "s3tables:GetTableMetadataLocation",
                   "s3tables:GetTableData",
                   "s3tables:PutTableData"
               ],
               "Resource": [
                   "arn:aws:s3tables:us-east-1:123456789012:bucket/*"
               ]
           }
       ]
   }
   ```

------

   如需詳細資訊，請參閱[用於註冊位置的角色需求](registration-role.md)。

1.  將下列信任政策新增至 IAM 角色，以允許 Lake Formation 服務擔任角色，並將臨時憑證提供給整合的分析引擎。

   ```
   {
     "Effect": "Allow",
     "Principal": {
       "Service": "lakeformation.amazonaws.com"
     },
     "Action": [
       "sts:AssumeRole",
       "sts:SetSourceIdentity",
       "sts:SetContext"  # add action to trust relationship when using IAM Identity center principals with Lake Formation
     ]
   }
   ```

**注意**  
 AWS 分析服務整合程序已更新。如果您已設定與預覽版本的整合，您可以繼續使用目前的整合。不過，更新的整合程序可提供效能改善。若要更新整合：  
首先，刪除 Lake Formation 中現有的 S3 資料表目錄。若要刪除目錄，請從`s3tablescatalog`目錄清單中選取目錄，然後選擇從**動作****中刪除**。
接著，取消註冊 的資料位置`s3tablescatalog`。  
在 Lake Formation 主控台的**管理**區段下，選擇**資料位置**。
選取位置，然後從**動作**功能表中選擇**移除**。
出現確認提示時，請選擇**移除**。  
如需取消註冊資料位置的詳細說明，請參閱 [取消註冊 Amazon S3 位置](unregister-location.md)一節。
然後，遵循 [啟用 Amazon S3 Tables 整合](enable-s3-tables-catalog-integration.md)區段中的更新整合步驟。