Terraform google';计算。子网。使用';许可问题

Terraform google';计算。子网。使用';许可问题,terraform,Terraform,我正在尝试使用terraform在Google cloud中创建一个实例,并在每次应用时继续运行到“compute.subnetworks.use”权限错误。有关代码的分段如下: network_interface { subnetwork_project = "hp-cof-st-core-sbx-dev" subnetwork = "net-cof-st-core-sbx-dev-entfacing-ue4-1" } 我想通过

我正在尝试使用terraform在Google cloud中创建一个实例,并在每次应用时继续运行到“compute.subnetworks.use”权限错误。有关代码的分段如下:

network_interface {
    subnetwork_project = "hp-cof-st-core-sbx-dev"
    subnetwork = "net-cof-st-core-sbx-dev-entfacing-ue4-1"


  }
我想通过“与我共享的网络设置”使用子网创建一个实例。下面给出了如何通过门户配置it的示例:

谷歌门户内的配置

每当我试图在terraform中配置此功能时,我都会收到以下消息:

错误:应用计划时出错:

发生1个错误:

  • google_compute_实例。默认值:发生1个错误:

  • google_compute_instance.default:创建实例时出错:googleapi:错误403:必需的“compute.subnetworks.use”权限“projects/hp COFST core sbx dev/regions/us-east4-a/subnetworks/net-cof-st-core-sbx-dev-entface-ue4-1”,禁止


用于创建实例的服务帐户必须具有编辑器或管理员角色才能创建实例。您可以通过转到IAM和“管理”菜单并将角色更改为“编辑”或“管理”来更新此内容。

如果问题已解决,请将解决方案共享给社区