中樞管理員可以授權特定使用者,在與中樞相關聯的其他專案中建立 Spoke,並保留對中樞接受哪些 Spoke 的完整控制權。您必須明確接受,Spoke 才會啟用。如有需要,你也可以隨時拒絕語音。
如要授予其他使用者在與中樞相關聯的其他專案中建立 Spoke 的權限,可以將 roles/networkconnectivity.groupUser
角色授予該使用者。如果使用者在中心具有 groupUser
角色,透過 Identity and Access Management (IAM) 資源階層,該使用者會自動在中心的所有群組中具有該角色。中樞管理員也可以撤銷使用者的存取權。
事前準備
開始設定前,請先詳閱下列各節。
建立或選取專案
為方便設定 Network Connectivity Center,請先找出有效的專案。
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure 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.
-
Make sure 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)'
在 Google Cloud 控制台中,前往「Network Connectivity Center」頁面。
按一下「啟用」。
在 Google Cloud 控制台中,前往「Network Connectivity Center」頁面。
在專案選單中選取專案。
按一下「Hubs」(中樞) 分頁標籤。
在中心清單中,選取要新增存取權的中心。
按一下 [權限]。
在「權限」對話方塊中,按一下「新增主體」。
輸入要新增的管理員使用者名稱。
在「管理角色」對話方塊中,從「網路連線」角色清單選取要指派的角色,例如「Spoke 管理員」。
按一下 [儲存]。
HUB_NAME
:輪輻的中心,例如my-hub
。MEMBER_DETAILS
:要授予存取權的使用者詳細資料。如要詳細瞭解 ID 和格式,請參閱「主體 ID」。HUB_NAME
:輪輻的中心,例如my-hub
。MEMBER_DETAILS
:要移除存取權的使用者詳細資料。如要詳細瞭解 ID 和格式,請參閱「主體 ID」。- 如要建立中樞和輪輻,請參閱「與中樞和輪輻搭配使用」。
- 如要查看解決方案已整合 Network Connectivity Center 的合作夥伴清單,請參閱「Network Connectivity Center 合作夥伴」。
- 如要尋找常見問題的解決方案,請參閱疑難排解。
- 如要瞭解 API 和
gcloud
指令的詳細資料,請參閱「API 和參考資料」。
啟用 Network Connectivity API
您必須先啟用 Network Connectivity API,才能使用 Network Connectivity Center 執行任何工作。
控制台
如要啟用 Network Connectivity API,請按照下列步驟操作:
或者,您也可以使用Google Cloud 控制台 API 程式庫啟用 API,如「啟用 API」一文所述。
管理跨專案中樞的 Spoke 建立存取權
下列各節說明如何授予、撤銷或查看權限,以便在與中樞不同的專案中建立輪輻。
將中樞的 groupUser
角色授予其他使用者
如要將中樞裝置的 networkconnectivity.groupUser
角色授予其他使用者,請按照下列步驟操作。
主控台
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'
更改下列內容:
撤銷使用者的中心 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'
更改下列內容:
查看使用者的權限
如要查看授予使用者的中心權限,請按照下列步驟操作。
gcloud
執行 gcloud network-connectivity hubs get-iam-policy
指令。
gcloud network-connectivity hubs get-iam-policy HUB_NAME
將 HUB_NAME
替換為要查看權限的中心名稱,例如 my-hub
。