将无服务器VPC连接器连接到主机项目中云的权限问题

发布于 2025-02-13 23:00:33 字数 395 浏览 0 评论 0原文

我在项目X中有一个需要访问VM实例的服务,我允许使用无服务器VPC连接器(在A host 项目中创建)访问该实例。 。我的问题是,在跟随 this 指南是有指南在云运行中部署新的修订时(在A service 项目中运行)时,似乎是一个权限问题:

请确保项目的服务代理具有权限[VPCACCESS.CONNECTORS.USE]用于在资源项目上进行操作连接/.../ Connector

I have a service in Cloud Run in project x that needs to access a VM instance, which I am allowing access to using a serverless VPC connector (created in a host project). My problem, while following this guide is that there appears to be a permission issue when deploying a new revision in Cloud Run (running in a service project):

Please ensure the project's service agent has the permission [vpcaccess.connectors.use] for action Connect on resource projects/.../connector

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

原谅我要高飞 2025-02-20 23:00:33

仔细阅读找到的文档此处,特别是

在主机项目中,部署云运行服务的授予校长vpc访问查看器(vpcaccess.viewer)角色。

  1. 打开iam页。
  2. 单击项目下拉菜单,然后选择主机项目。
  3. 单击添加。
  4. 新校长字段中,输入应该能够从服务项目中查看连接器的本金的电子邮件地址。您可以在此字段中输入多个电子邮件。
  5. 角色字段中,选择无服务器VPC Access Viewer

回顾错误消息,似乎建议cloud Run服务帐户在访问主机项目中的VPC连接器时遇到了困难。因此,通过添加服务项目的云运行服务帐户在主机项目的IAM页面中使用>无服务器vpc access Viewer许可,Cloud Run的服务帐户能够访问外部项目中的连接器,我能够使用无服务器共享的VPC连接器成功重新运行云。

请注意,一旦添加此权限,在iam页面中,名称应该说“ Google Cloud Run Service Agent for Project Service-Project-ID”。

It is very important to closely read the documentation found here, specifically this portion:

On the host project, grant principals who deploy Cloud Run services the Serverless VPC Access Viewer (vpcaccess.viewer) role.

  1. Open the IAM page.
  2. Click the project dropdown menu and select the host project.
  3. Click Add.
  4. In the New principals field, enter the email address of the principal that should be able to see the connector from the service project. You can enter multiple emails in this field.
  5. In the Role field, select Serverless VPC Access Viewer.

Looking back at the error message, it seems to suggest that the Cloud Run service account is having trouble accessing the VPC connector in the host project. So, by adding the Cloud Run service account from the service project in the host project's IAM page with the Serverless VPC Access Viewer permission, Cloud Run's service account was able to access the connector in an outside project, and I was able to successfully re-deploy Cloud Run using the serverless shared VPC connector.

Note that once you add this permission, in the IAM page the name should say something like "Google Cloud Run Service Agent for Project SERVICE-PROJECT-ID".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文