将 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-04-02。"],[[["`gcloud beta terraform vet` replaces the `terraform-validator` project with some minor changes, and is subject to the \"Pre-GA Offerings Terms\"."],["Migrating to `gcloud beta terraform vet` requires updating the command from `terraform-validator validate` to `gcloud beta terraform vet`, and replacing `--policy-path` with `--policy-library`."],["Service account impersonation can be used with `gcloud beta terraform vet` by adding the `--impersonate-service-account` flag."],["It's recommended to use the newer format for writing policies and upgrade existing policies from `v1alpha1`, especially when sourcing from `github.com/GoogleCloudPlatform/policy-library`."]]],[]]