A framework for managing infrastructure-as-code components via Pulumi with tenant isolation, async execution, and pluggable backends.
Project description
Pulice
A Python framework for managing infrastructure-as-code components via Pulumi with tenant isolation, async execution, and pluggable backends.
Features
- Component model — Define cloud resources as
ManagedComponentsubclasses with Pydantic-validated inputs - Tenant isolation — Named boundaries ensure stacks belonging to different environments never collide
- 9 lifecycle operations — create, read, update, delete, refresh, list, status, export, import
- CLI + HTTP API — Synchronous CLI for interactive use; async FastAPI server for automation
- Pluggable task backends — Huey (SQLite, zero-dep) or Celery (Redis, distributed)
- Passphrase-protected stacks — scrypt-hashed passphrases validated before any Pulumi call
- Advisory locking — Prevents concurrent mutating operations on the same stack
- Provider-agnostic — Works with any Pulumi provider (AWS, GCP, Azure, Kubernetes, etc.)
Installation
pip install pulice
With optional extras:
pip install pulice[api] # FastAPI server + Huey worker
pip install pulice[celery] # Celery backend for distributed deployments
pip install pulice[aws] # AWS provider
Quick Start
Define a component:
from pulice import ComponentArgs, ManagedComponent
from pydantic import Field
import pulumi
import pulumi_aws as aws
class BucketArgs(ComponentArgs):
region: str = Field(description="AWS region")
class Bucket(ManagedComponent):
args_model = BucketArgs
def __init__(self, name: str, args: BucketArgs, opts=None, **kwargs):
super().__init__("pulice:aws:Bucket", name, {}, opts)
aws.s3.BucketV2(f"{name}-bucket", opts=pulumi.ResourceOptions(parent=self))
Register and run:
from typer import Typer
from pulice import PuliceCLI
app = Typer()
cli = PuliceCLI(app)
cli.register_component(Bucket, name="bucket")
if __name__ == "__main__":
cli()
Use it:
pulice tenant create --name dev
pulice bucket create --name my-data --region eu-west-1 --tenant dev --passphrase secret
pulice bucket list --tenant dev
pulice bucket delete --stack-reference <ref> --tenant dev --passphrase secret
HTTP API
pip install pulice[api]
uvicorn pulice.api:create_api --factory --host 0.0.0.0 --port 8000
huey_consumer pulice.worker.huey -w 2 -k process
Submit operations asynchronously:
curl -X POST http://localhost:8000/stacks/operations \
-H "Content-Type: application/json" \
-d '{"component_class": "myapp.Bucket", "operation": "create", "tenant": "dev", "passphrase": "secret", "args": {"name": "my-data", "region": "eu-west-1"}}'
Documentation
Full documentation is available at the project site or can be built locally:
pip install pulice[docs]
zensical serve
License
MIT — Mike Fischer and Dani Vela Calderón
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pulice-0.1.0.tar.gz.
File metadata
- Download URL: pulice-0.1.0.tar.gz
- Upload date:
- Size: 29.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f658be286519d8098ad5aa61c97f84847b098951527a231f53b3bde9c42fad09
|
|
| MD5 |
5003d630a296b5020ba2054bf80d5f8a
|
|
| BLAKE2b-256 |
b18a2b89e29816e3fdb01b6fb47931388f41fb8b680a1b1778457f1c575aca81
|
File details
Details for the file pulice-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pulice-0.1.0-py3-none-any.whl
- Upload date:
- Size: 43.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4388b64a847ca05f69ee2473e596fd819703f966e6cfeca10b822704418d5cb
|
|
| MD5 |
062f80bd115506b3cf9456952ad26a0c
|
|
| BLAKE2b-256 |
fff0bd5ef3973f850bcc84f87092c98b628f30f63a1c7c81d1476404d7d6b633
|