Resource Ancestry 用于构建准确的 CAI 资产名称。如果 gcloud beta terraform vet 无法自动确定 CAI 资产的祖先实体,将返回错误 project: required field is not set。您可以使用 --project 标志提供默认项目,也可以使用 gcloud config 设置默认项目。
为什么我会收到一条指出 getting resource ancestry for project PROJECT_ID: googleapi: Error 403: The caller does not have permission, forbidden 的错误?
运行带有 --verbosity=debug 的命令,并查找类似于 Terraform
is using this identity: 的消息。该消息应后跟一个电子邮件地址,即用于 API 请求的账号。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-04-02。"],[[["Pre-General Availability (Pre-GA) products and features are governed by the \"Pre-GA Offerings Terms\" in the General Service Terms."],["Pre-GA offerings are provided \"as is\" with potentially limited support, as detailed in the launch stage descriptions."],["Constraint violations may not trigger errors if the policy library is incorrectly set up, the resource is unsupported, or the constraint targets the wrong resource type."],["The error \"project: required field is not set\" indicates that the tool cannot determine the CAI Asset's ancestry and requires a project to be specified."],["A \"permission denied\" error when getting resource ancestry suggests an authentication issue or insufficient permissions for the specified identity."]]],[]]