本頁說明如何建立及管理攔截部署群組。
事前準備
- 在專案中啟用 Network Security API。
- 安裝 gcloud CLI。
角色
如要建立、查看或刪除攔截部署群組,您的 Identity and Access Management (IAM) 主體必須具備專案的必要 Identity and Access Management (IAM) 角色。詳情請參閱「管理專案、資料夾和機構的存取權」。
如要查看這個頁面列出的作業進度,您的 Identity and Access Management (IAM) 主體必須具備下列 Intercept Deployment Admin 角色 (roles/networksecurity.interceptDeploymentAdmin) 權限:
networksecurity.interceptDeploymentGroups.createnetworksecurity.interceptDeploymentGroups.deletenetworksecurity.interceptDeploymentGroups.getnetworksecurity.interceptDeploymentGroups.list
建立攔截部署作業群組
攔截部署項目群組是全域資源,內含一組可用區攔截部署項目。
控制台
前往 Google Cloud 控制台的「Deployment groups」(部署群組) 頁面。
按一下「建立部署群組」。
在「Name」欄位輸入部署群組的不重複名稱。
在「Network」(網路) 中,選取虛擬私有雲網路。所有攔截部署作業都必須參照使用這個網路的內部直通式網路負載平衡器。
點選「建立」。
gcloud
如要建立攔截部署群組,請使用 gcloud
network-security intercept-deployment-groups create 指令:
gcloud network-security intercept-deployment-groups create DEPLOYMENT_GROUP_ID \
--location global \
--no-async \
--network NETWORK
更改下列內容:
DEPLOYMENT_GROUP_ID:攔截部署項目群組的 ID。NETWORK:虛擬私有雲網路的名稱。所有攔截部署作業都必須參照使用這個網路的內部直通式網路負載平衡器。
Terraform
如要建立攔截部署群組,可以使用 google_network_security_intercept_deployment_group 資源。
如要瞭解如何套用或移除 Terraform 設定,請參閱「基本 Terraform 指令」。
查看攔截部署作業群組的詳細資料
您可以查看攔截部署群組的詳細資料,例如名稱和網路。
控制台
前往 Google Cloud 控制台的「Deployment groups」(部署群組) 頁面。
按一下部署作業群組。
gcloud
如要查看攔截部署群組的詳細資料,請使用 gcloud
network-security intercept-deployment-groups describe 指令:
gcloud network-security intercept-deployment-groups describe DEPLOYMENT_GROUP_ID \
--location global
將 DEPLOYMENT_GROUP_ID 替換為攔截部署群組的 ID。
輸出內容會以 projects/PROJECT_ID/locations/global/interceptDeploymentGroups/DEPLOYMENT_GROUP_ID 格式顯示攔截部署項目群組名稱。
列出攔截部署項目群組
您可以列出專案中的所有攔截部署群組,包括 ID。
控制台
如要查看專案的所有攔截部署項目群組,請完成下列步驟:
前往 Google Cloud 控制台的「Deployment groups」(部署群組) 頁面。
如要列出攔截部署群組,請按一下「篩選」圖示 filter_list。
在「Properties」清單中選取「Purpose」,然後在「Value」中選取「NSI In-band」。
gcloud
如要列出專案的所有攔截部署群組,請使用 gcloud network-security intercept-deployment-groups list 指令:
gcloud network-security intercept-deployment-groups list
刪除攔截部署項目群組
刪除攔截部署項目群組前,請先刪除參照該群組的攔截部署項目。
控制台
前往 Google Cloud 控制台的「Deployment groups」(部署群組) 頁面。
勾選部署群組的核取方塊,然後按一下「刪除」。
再按一下 [刪除] 加以確認。
gcloud
如要刪除攔截部署群組,請使用 gcloud
network-security intercept-deployment-groups delete 指令:
gcloud network-security intercept-deployment-groups delete DEPLOYMENT_GROUP_ID \
--no-async \
--location global
將 DEPLOYMENT_GROUP_ID 替換為攔截部署群組的 ID。