Policy pack project file (PulumiPolicy.yaml)
Every Pulumi policy pack has a project file, PulumiPolicy.yaml, that specifies metadata about the policy pack such as its runtime and version. This file is analogous to the Pulumi.yaml project file used by Pulumi IaC programs. The file must be named PulumiPolicy.yaml (case-sensitive) and placed in the root of your policy pack directory.
When you create a new policy pack with pulumi policy new, the CLI generates this file automatically.
Select your policy pack runtime to see the relevant attributes and examples:
Attributes
| Name | Required | Description |
|---|---|---|
runtime | required | Must be nodejs. Can be a string or an object with name and options fields. See runtime options. |
version | optional | The version of the policy pack, following semantic versioning. Overrides the version in package.json when set. |
main | optional | Path to the policy pack entry point, relative to PulumiPolicy.yaml. Defaults to the directory containing PulumiPolicy.yaml. |
description | optional | A brief description of the policy pack. |
author | optional | The author of the policy pack. |
website | optional | A URL for the policy pack's website or repository. |
license | optional | The license for the policy pack (e.g., Apache-2.0, MIT). |
runtime options
The runtime attribute can be a simple string or an object with additional options.
Simple form:
runtime: nodejsObject form:
runtime:
name: nodejsThe Node.js runtime does not have additional options specific to policy packs.
Version handling
The version is read from package.json by default. If a version field is set in PulumiPolicy.yaml, it takes precedence over package.json.
Each version can only be published once. When you publish a new version, update the version number before running pulumi policy publish. See managing policy pack versions for details.
Examples
Minimal:
runtime: nodejsFull-featured:
runtime: nodejs
version: 1.2.0
main: src/
description: Acme Corp security and compliance policies
author: Platform Team
website: https://github.com/acme/policy-packs
license: Apache-2.0