在無邊界湖倉中,您可以透過 Lakehouse 執行階段目錄,為目錄端點啟用憑證臨時配發模式。
憑證臨時配發模式會將範圍縮小的短期儲存空間權杖,配發給授權的查詢引擎和工作負載。採用這種驗證方式後,您或查詢執行階段就不需要具備基礎 Cloud Storage bucket 的直接讀取和寫入權限。
事前準備
- 請參閱「關於 Lakehouse 執行階段目錄」,瞭解 Lakehouse 執行階段目錄的運作方式和服務限制。
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles. - Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
Verify that billing is enabled for your Google Cloud project.
Enable the BigLake API, if it is not already enabled.
Roles required to enable APIs
To enable APIs, you need the serviceusage.services.enable permission. If you
created the project, then you likely already have this permission through the
Owner role (roles/owner). Otherwise, you can get this permission through the
Service Usage Admin role (roles/serviceusage.serviceUsageAdmin).
Learn how to grant roles.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
Verify that billing is enabled for your Google Cloud project.
Enable the BigLake API, if it is not already enabled.
Roles required to enable APIs
To enable APIs, you need the serviceusage.services.enable permission. If you
created the project, then you likely already have this permission through the
Owner role (roles/owner). Otherwise, you can get this permission through the
Service Usage Admin role (roles/serviceusage.serviceUsageAdmin).
Learn how to grant roles.
必要的角色
如要取得啟用憑證販售功能所需的權限,請要求管理員授予您下列 IAM 角色:
-
全部:
- 專案的 BigLake 管理員 (
roles/biglake.admin) - 專案的儲存空間管理員 (
roles/storage.admin)
- 專案的 BigLake 管理員 (
-
自動佈建的 Apache Iceberg REST 目錄服務帳戶:所有相關聯 Cloud Storage bucket 的 Storage 物件使用者 (
roles/storage.objectUser)。啟用憑證販售功能後,請將所有相關聯 Storage bucket 的 Storage 物件使用者角色 (roles/storage.objectUser),明確授予目錄自動佈建的 Apache Iceberg REST 目錄服務帳戶。
如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和組織的存取權」。
啟用憑證販售
如果 Apache Iceberg REST 目錄端點的驗證方式設為使用者憑證,您可以切換至憑證臨時配發模式。
控制台
- 在 Google Cloud 控制台,開啟「Lakehouse」Lakehouse頁面。
在要更新的目錄列中,依序選取 「More catalog actions」(更多目錄動作) >「Edit authentication」(編輯驗證)。
在驗證對話方塊中,選取「Credential vending mode」(憑證臨時配發模式)。自動佈建的 Apache Iceberg REST 目錄服務帳戶,必須在所有相關聯的 Cloud Storage bucket 上,明確具備 Storage 物件使用者角色 (
roles/storage.objectUser)。根據預設,這個帳戶沒有任何存取權。如果沒有這個角色,提供的憑證就沒有足夠的範圍來執行儲存空間寫入作業。選取「儲存」。
Your catalog is updated and the **Catalog details** page opens.在「驗證方式」下方,選取「設定 bucket 權限」。
在對話方塊中選取「確認」。
這可驗證目錄的服務帳戶在所有相關聯的儲存空間 bucket,是否具備 Storage 物件使用者角色 (roles/storage.objectUser)。
gcloud
使用 gcloud biglake iceberg catalogs update 指令。
gcloud biglake iceberg catalogs update \ CATALOG_NAME \ --project PROJECT_ID \ --credential-mode vended-credentials
更改下列內容:
CATALOG_NAME:目錄名稱。如果是 Lakehouse 目錄,則為自訂目錄名稱。如果是 Cloud Storage bucket 目錄,這會與 REST 目錄使用的 Cloud Storage bucket ID 相符。從 BigQuery 查詢這些資料表時,這個名稱也會做為目錄 ID。PROJECT_ID:您的 Google Cloud專案 ID。啟用憑證販售功能後,請將所有相關聯 Storage bucket 的 Storage 物件使用者角色 (
roles/storage.objectUser),明確授予目錄自動佈建的 Apache Iceberg REST 目錄服務帳戶。
REST
如要使用 REST API 啟用憑證販售模式,請向 UpdateIcebergCatalog 端點發出 PATCH 要求:
PATCH /iceberg/v1/restcatalog/extensions/projects/PROJECT_ID/catalogs/CATALOG_ID?updateMask=credential_mode
要求主體必須包含 IcebergCatalog JSON 酬載,且 credential_mode 設為 VENDED_CREDENTIALS。
更改下列內容:
PROJECT_ID:您的 Google Cloud 專案 ID。CATALOG_ID:Lakehouse 執行階段目錄的 ID。