嘿,我正在尝试使用带有 terraform 的哨兵 cli 我有一个 policy.sentinel 文件
import "tfplan"
allowed_machine_types = [
"n1-standard-1",
"n1-standard-2",
"n1-standard-4",
"n1-standard-8",
]
main = rule {
all tfplan.resources as type, resources {
all resources as r {
r.applied.machine_type in allowed_machine_types
}
}
}
和一个用于我的导入的 config.json 文件
{
"imports":{
"tfplan": {
"path": "./plan"
}
}
}
计划是运行后生成的可执行文件
terraform plan -out plan
当我跑步时sentinel apply -config=config.json policy.sentinel
我的错误
Runtime error while running the policy:
test.sentinel:1:1: fork/exec ./plan: exec format error
A runtime error is a non-recoverable error and always represents a bug
in the policy. When a runtime error is experienced, the result of the
policy is "false". Please fix the error above and try again.
我不太擅长哨兵,所以可能是什么问题?我们如何使用进口?我尝试浏览文档,但我不知道如何去做