skillfed

pulumi-policy

Pulumi's Policy Python SDK

pulumi-policy v1.21.0 316.5K downloads/30d#7,677 on PyPI44
Permissive license Apache 2.0 Active released

What it is and what it does

Pulumi Policy SDK is a Python library for writing and enforcing policy rules on infrastructure deployed through Pulumi. It runs during `pulumi preview` and `pulumi up` to validate that cloud resources comply with organizational standards before creation or update. Rules can be set to advisory (warnings), mandatory (errors), or remediate (automatic fixes), with violations batched during preview and halting deployment on first error during update.

The package depends on pulumi, protobuf, grpcio, and setuptools. Policies written in Python can be applied to Pulumi stacks written in any language, making it a cross-language governance tool. It is actively maintained and widely used in the Pulumi ecosystem.

Use it for:

  • Enforce tagging standards on all cloud resources before deployment to ensure compliance and cost tracking.
  • Validate that databases and storage are encrypted and publicly accessible resources are restricted.
  • Automatically remediate common misconfigurations like missing backup policies or non-compliant naming conventions.
  • Prevent deployment of resources that violate security or cost policies during preview phase.
  • Implement organizational standards across teams using Pulumi in different languages.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Defines and enforces policy rules on cloud resources during Pulumi deployments, with support for advisory warnings, mandatory errors, and automatic remediation.

Yes. The package is actively maintained, has low install friction, carries a permissive license, and solves a real need for infrastructure governance in Pulumi deployments. It is stable and widely adopted (top 15000 PyPI packages). Install if you use Pulumi and need to enforce policy on cloud resources.

Install

pulumi-policy on PyPI

pip

pip install pulumi-policy

uv

uv add pulumi-policy

poetry

poetry add pulumi-policy

Installing pulumi-policy

Before you install

Low install friction with a pure-Python wheel distribution. Actively maintained as of 2026-08-09 with regular releases; last update 86 days ago.

License in practice

Licensed under Apache 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions.

Quickstart

pip install pulumi-policy

from pulumi_policy import (
    EnforcementLevel,
    PolicyPack,
    ResourceValidationPolicy,
)

PolicyPack(
    name="my-policy",
    enforcement_level=EnforcementLevel.MANDATORY,
    policies=[
        ResourceValidationPolicy(
            name="my-rule",
            description="Example policy rule",
            validate=lambda args: [],
        ),
    ],
)

Verify before relying

  • Whether Python version constraints exist beyond what the fact sheet specifies (requires_python is unspecified)
  • Whether the package works with all Pulumi stack languages or has language-specific limitations in practice

Package facts

License Apache 2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 4 — pulumi, protobuf, grpcio, setuptools
Maintenance actively maintained — 86 days since the last release
Last repo commit
First released
Downloads 316,453/month — #7,677 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pulumi_policy-1.21.0-py2.py3-none-any.whl

Tags

pulumi policy enforcementcloud resource compliance rulespolicy as code for infrastructurepulumi crossguard policiesinfrastructure policy validationautomated policy remediationdeployment policy checks
policy-as-codeinfrastructure-governancepulumi-ecosystem

More Quality Assurance packages