将 terraform-validator validate 替换为 gcloud beta terraform vet
将 --policy-path 替换为 --policy-library
基本示例:
# Old
terraform-validatorvalidate./tfplan.json--policy-path=/path/to/policy-library
# New
gcloudbetaterraformvet./tfplan.json--policy-library=/path/to/policy-library
[[["易于理解","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-08-18。"],[[["\u003cp\u003e\u003ccode\u003egcloud beta terraform vet\u003c/code\u003e replaces the \u003ccode\u003eterraform-validator\u003c/code\u003e project with some minor changes, and is subject to the "Pre-GA Offerings Terms".\u003c/p\u003e\n"],["\u003cp\u003eMigrating to \u003ccode\u003egcloud beta terraform vet\u003c/code\u003e requires updating the command from \u003ccode\u003eterraform-validator validate\u003c/code\u003e to \u003ccode\u003egcloud beta terraform vet\u003c/code\u003e, and replacing \u003ccode\u003e--policy-path\u003c/code\u003e with \u003ccode\u003e--policy-library\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eService account impersonation can be used with \u003ccode\u003egcloud beta terraform vet\u003c/code\u003e by adding the \u003ccode\u003e--impersonate-service-account\u003c/code\u003e flag.\u003c/p\u003e\n"],["\u003cp\u003eIt's recommended to use the newer format for writing policies and upgrade existing policies from \u003ccode\u003ev1alpha1\u003c/code\u003e, especially when sourcing from \u003ccode\u003egithub.com/GoogleCloudPlatform/policy-library\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]