当我尝试跑步时
steps:
- id: Plan Terraform
name: hashicorp/terraform:light
args:
- plan
在 Cloud Build 中,我收到错误:
Error: Error reading Project Service foo/cloudbuild.googleapis.com: googleapi: Error 403: Cloud Resource Manager API has not been used in project 123456789 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudresourcemanager.googleapis.com/overview?project=123456789 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured
Since 相同的 terraform 定义正在我的本地计算机上运行我认为错误消息有点误导,实际上是一个凭据问题。
根据 Google Cloud 文档,我应用了以下内容:
resource "google_project_iam_binding" "cloudbuild" {
project = "bar"
role = "roles/editor"
members = [
"serviceAccount:[email protected] /cdn-cgi/l/email-protection"
]
}
但该错误仍然存在。
知道这里可能存在什么问题/解决方案吗?
必须手动启用云资源管理器API and 服务使用API让 Terraform 工作。
但不知道为什么它可以通过我的本地机器工作。因此,这对我来说仍然没有完全理解/解决。
我的猜测是,也许在本地它使用 gcloud 来访问这些东西,并以另一种方式获取数据?
或者也许用户帐户与服务帐户有不同的限制?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)