身為中樞管理員,您可以授予特定使用者權限,讓他們在與中樞相關聯的其他專案中建立 Spoke,並全面控管哪些 Spoke 可加入中樞。您必須明確接受,Spoke 才會啟用。如有需要,您也可以隨時拒絕輪輻。
如要授權其他使用者在與中樞相關聯的其他專案中建立輪輻,請將 roles/networkconnectivity.groupUser 角色指派給該使用者。如果使用者在中心具有groupUser角色,透過 Identity and Access Management (IAM) 資源階層,該使用者在中心的所有群組中也會自動具有該角色。中樞管理員也可以撤銷使用者的存取權。
事前準備
開始之前,請先詳閱下列各節。
建立或選取專案
如要輕鬆設定 NCC,請先找出有效的專案。
- 登入 Google Cloud 帳戶。如果您是 Google Cloud新手,歡迎 建立帳戶,親自體驗產品的實際應用成效。新客戶還能獲得價值 $300 美元的免費抵免額,能用於執行、測試及部署工作負載。
-
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
- 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.
-
Verify that billing is enabled for your Google Cloud project.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init -
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
- 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.
-
Verify that billing is enabled for your Google Cloud project.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init 如果您使用 Google Cloud CLI,請使用
gcloud config set指令設定專案 ID。gcloud config set project PROJECT_ID
將
PROJECT_ID替換為專屬專案 ID。本頁面的 gcloud CLI 操作說明假設您已設定專案 ID。
如要確認專案 ID 設定正確,請使用
gcloud config list指令。gcloud config list --format='text(core.project)'
啟用 Network Connectivity API
您必須先啟用 Network Connectivity API,才能使用 Network Connectivity Center (NCC) 執行任何工作。
控制台
如要啟用 Network Connectivity API,請按照下列步驟操作:
前往 Google Cloud 控制台的「Network Connectivity Center」(網路連線中心) 頁面。
按一下「啟用」。
或者,您也可以使用Google Cloud 控制台 API 程式庫啟用 API,詳情請參閱「啟用 API」。
管理權限,在不同專案的中樞建立輪輻
以下各節說明如何授予、撤銷或查看權限,以便在與中心不同的專案中建立輻射網路。
將中樞的 groupUser 角色授予其他使用者
如要將中樞的 networkconnectivity.groupUser 角色授予其他使用者,請按照下列步驟操作。
控制台
前往 Google Cloud 控制台的「Network Connectivity Center」頁面。
在專案選單中選取專案。
按一下「Hubs」(中樞) 分頁標籤。
在中心清單中,選取要新增存取權的中心。
按一下「權限」。
在「Permissions」(權限) 對話方塊中,按一下「Add principal」(新增主體)。
輸入要新增的管理員使用者名稱。
在「管理角色」對話方塊中,從「網路連線」角色清單選取要指派的角色,例如「Spoke 管理員」。
按一下 [儲存]。
gcloud
執行 gcloud network-connectivity hubs add-iam-policy-binding 指令。
gcloud network-connectivity hubs add-iam-policy-binding HUB_NAME \
--member=MEMBER_DETAILS \
--role='roles/networkconnectivity.groupUser'
更改下列內容:
HUB_NAME:輪輻的中樞,例如my-hub。MEMBER_DETAILS:要授予存取權的使用者詳細資料。如要進一步瞭解 ID 和格式,請參閱「主體 ID」。
撤銷使用者的中樞 groupUser 角色
如要撤銷使用者在中心中的 roles/networkconnectivity.groupUser 角色,請按照下列步驟操作。
gcloud
執行 gcloud network-connectivity hubs remove-iam-policy-binding 指令。
gcloud network-connectivity hubs remove-iam-policy-binding HUB_NAME \
--member=MEMBER_DETAILS \
--role='roles/networkconnectivity.groupUser'
更改下列內容:
HUB_NAME:輻射網路的中心,例如my-hub。MEMBER_DETAILS:要移除存取權的使用者詳細資料。如要進一步瞭解 ID 和格式,請參閱「主體 ID」。
查看使用者的權限
如要查看已授予使用者中樞權限,請按照下列步驟操作。
gcloud
執行 gcloud network-connectivity hubs get-iam-policy 指令。
gcloud network-connectivity hubs get-iam-policy HUB_NAME
將 HUB_NAME 替換成要查看權限的中心名稱,例如 my-hub。
後續步驟
- 如要建立中樞和輪輻,請參閱「使用中樞和輪輻」。
- 如要查看解決方案與 NCC 整合的合作夥伴清單,請參閱「NCC 合作夥伴」。
- 如要瞭解常見問題的解決方案,請參閱「疑難排解」。
- 如要進一步瞭解 API 和
gcloud指令,請參閱「API 與參考資料」。