資源階層可用於建立準確的 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"]],["上次更新時間:2025-06-04 (世界標準時間)。"],[[["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."]]],[]]