pulumi-policy
Pulumi's Policy Python SDK
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-policyuv
uv add pulumi-policypoetry
poetry add pulumi-policyInstalling 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
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
pulumi-dockerPulumi provider for managing Docker resources…
permissive · top 5,000 on PyPI
pulumi-google-nativePulumi provider for provisioning Google Cloud…
permissive · top 15,000 on PyPI
pulumi-gcpPulumi resource provider for Google Cloud…
permissive · top 5,000 on PyPI
pulumi-tlsPulumi resource provider for creating and…
permissive · top 5,000 on PyPI
pulumi-pulumiservicePulumi Service Provider enables programmatic…
permissive · top 15,000 on PyPI
pulumiPulumi's Python SDK lets you define and deploy…
permissive · top 5,000 on PyPI
c7n-azureAn Azure plugin for Cloud Custodian that…
permissive · top 15,000 on PyPI
invenio-records-permissionsDefines and enforces permission policies for…
permissive · top 15,000 on PyPI
c7nCloud Custodian is a rules engine that enforces…
permissive · top 5,000 on PyPI
regopyregopy wraps the Open Policy Agent's Rego…
permissive · top 15,000 on PyPI