本文档介绍如何使用 Developer Connect 账号连接器的高级配置选项。
账号连接器是一项 Developer Connect 功能,可帮助您将 Google Cloud 账号与非 Google 开发者工具提供商的个人账号相关联。用户可以通过为账号连接器选择适当的范围来指定账号连接器要访问的数据类型。为组织创建账号连接器后,该组织内的用户可以使用该连接来授权其个人账号与该连接一起使用。
准备工作
-
登录您的 Google 账号。
如果您还没有 Google 账号,请 注册新账号。
-
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.
Enable the Developer Connect API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. 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
- 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.
Enable the Developer Connect API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.- 可选:创建客户管理的 加密密钥 (CMEK),用于加密 Developer Connect 创建的身份验证 Secret。
启用 Developer Connect 也会启用 Secret Manager API。
所需角色
如需获得创建连接和链接所需的权限,请让您的管理员为您授予以下 IAM 角色:
-
如果您不是项目所有者:您的用户账号的 Developer Connect Admin (
roles/developerconnect.admin)。 -
如果您计划使用 CMEK 加密 Developer Connect 创建的 Secret:Secret Manager 服务账号的 Cloud KMS CryptoKey Encrypter/Decrypter (
roles/cloudkms.cryptoKeyEncrypterDecrypter)。 -
如果您计划使用 gcloud CLI 完成本指南中的步骤:Secret Manager Admin 角色 (
roles/secretmanager.admin) 在 Developer Connect 服务账号上。 -
如果您计划使用 Google Cloud 控制台完成本指南中的步骤:
Project IAM Admin (
roles/resourcemanager.projectIamAdmin) 您的用户账号。
如需详细了解如何授予角色,请参阅管理对项目、文件夹和组织的访问权限。
您也可以通过自定义 角色或其他预定义 角色来获取所需的权限。
创建账号连接器
如需创建新的账号连接器,请执行以下操作:
在 Google Cloud 控制台中,打开 Developer Connect。
选择账号连接器 。
点击创建连接器 。
选择要在其中创建此账号连接器的区域 。
为账号连接器指定一个名称 。
选择提供商。
选择要为此账号连接器授予 Developer Connect 的范围。
范围决定了 Developer Connect 可以在所选提供商的服务中执行哪些操作。范围因提供商而异。您必须至少选择一个范围,除非提供方没有范围。
根据提供方不同,可能无法选择任何范围。您可以手动添加范围。您可能还需要提供范围。
点击创建 以完成此账号连接器的创建。
关联账号
创建账号连接器后,您仍需要将 Developer Connect 与提供方的账号相关联,然后才能使用账号连接器。
在 Google Cloud 控制台中,打开 Developer Connect。
选择账号连接器 。
账号连接器 页面列出了您在项目中拥有的所有账号连接器。
点击要关联提供商账号的账号连接器的名称。
系统会显示连接器详细信息 页面。
点击关联账号 。
系统会显示一个 Oauth 身份验证对话框。
在对话框中提供信息,以向提供方进行身份验证。
点击授权 。
更新账号连接器
您可以更新现有账号连接器,但只能更新该连接器的范围。如果您更新给定账号连接器的范围,则该连接器的所有现有用户都将被清空。
在 Google Cloud 控制台中,打开 Developer Connect。
Developer Connect 会显示 Git 代码库 页面。
选择账号连接器 。
账号连接器 页面列出了您在项目中拥有的所有账号连接器。
点击要更新的账号连接器的名称。
系统会显示连接器详细信息 页面。
点击修改 。
从范围 列表中,选择要为此账号连接器允许的范围。
点击保存 。
删除账号连接器
在 Google Cloud 控制台中,打开 Developer Connect。
Developer Connect 会显示 Git 代码库 页面。
选择账号连接器 。
账号连接器 页面列出了您在项目中拥有的所有账号连接器。
从更多 菜单中,选择删除 。
系统会显示连接器详细信息 页面。
点击修改 。