Skip to content

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 ​

NameRequiredDescription
runtimerequiredMust be nodejs. Can be a string or an object with name and options fields. See runtime options.
versionoptionalThe version of the policy pack, following semantic versioning. Overrides the version in package.json when set.
mainoptionalPath to the policy pack entry point, relative to PulumiPolicy.yaml. Defaults to the directory containing PulumiPolicy.yaml.
descriptionoptionalA brief description of the policy pack.
authoroptionalThe author of the policy pack.
websiteoptionalA URL for the policy pack's website or repository.
licenseoptionalThe 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:

yaml
runtime: nodejs

Object form:

yaml
runtime:
  name: nodejs

The 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:

yaml
runtime: nodejs

Full-featured:

yaml
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

Content from the official Pulumi documentation (github.com/pulumi/docs).