#24658·pulumi

对于 `runtime: opa` 策略包,`pulumi policy new` 和 `pulumi install` 都失败

作者: pose创建于 2026年9月14日更新于 2026年9月16日
标签Bugpulumi/pulumiarea/policy

`pulumi policy new` exits 1 for every OPA template in pulumi/templates-policy (`AWS-opa`, `Azure-opa`, `GCP-opa`, `Kubernetes-opa`, all `runtime: opa`). After writing `PulumiPolicy.yaml` and `policy.rego`, it tries to load a `pulumi-language-opa` language plugin to install dependencies. That plugin does not exist: pulumi/pulumi-policy-opa ships only the `policy-opa` analyzer. `pulumi install` inside an OPA pack fails the same way. `--generate-only` exits 0, but its next steps tell you to run `pulumi install`, which fails. Running the pack works (`pulumi preview --policy-pack <dir>`), because the analyzer load path falls back to `pulumi-analyzer-policy-<runtime>` and auto-installs it since #22194.