View a markdown version of this page

共用 S3 Tables 目錄物件 - AWS Glue

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

共用 S3 Tables 目錄物件

使用 IAM 存取控制時,您可以使用相同帳戶共用 AWS Glue 的資源連結,與其他使用者共用 S3 Tables 目錄物件。對於跨帳戶共用,您可以與其他 AWS 帳戶共用 S3 資料表儲存貯體,而且收件人帳戶中的 IAM 角色或使用者可以使用共用資料表儲存貯體建立 AWS Glue 目錄物件。

資源連結可讓您在 AWS Glue 預設目錄中顯示的 中建立 AWS Glue 資料庫和資料表s3tablescatalog的參考。這有助於組織資料存取或建立資料表的邏輯分組。

  1. 在 https://https://console.aws.amazon.com/glue/ 開啟 AWS Glue 主控台。

  2. 在導覽窗格中,選擇目錄

  3. 目錄清單中,選取 s3tablescatalog

  4. 從 選取您要共用的資料表s3tablescatalog

  5. 選擇動作,然後選擇建立資源連結

  6. 針對資源連結名稱,輸入資源連結的名稱。

  7. 針對目標資料庫,選取您要建立資源連結的資料庫。

  8. 描述,請輸入描述。

  9. 選擇建立

資源連結會出現在目標資料庫中,並指向 中的原始資料表s3tablescatalog

建立資料庫資源連結:

aws glue create-database \ --database-name "my-database-resource-link" \ --database-input '{ "Name": "sales_data_link", "TargetDatabase": { "CatalogId": "account-id:s3tablescatalog/analytics-bucket", "DatabaseName": "sales" } }'

建立資料表資源連結:

aws glue create-table \ --table-name "my-table-resource-link" \ --table-input '{ "Name": "sales_data_link", "TargetTable": { "CatalogId": "account-id:s3tablescatalog/analytics-bucket", "DatabaseName": "sales", "Name": "transactions" } }'