Why Build a Provider?
Build a provider when you want to:- Manage internal tools - Bring your proprietary systems into the Pragma ecosystem
- Support new services - Add resources for cloud services, databases, or APIs not yet covered
- Standardize operations - Encode your team’s best practices into reusable resource types
- Enable reactive pipelines - Let your resources participate in dependency-driven workflows
Provider Architecture
A provider consists of three main components:Provider
A namespace that groups related resources. Think of it like a FastAPI router that collects related endpoints.Resource
The core abstraction. Each resource type:- Has a Config schema defining what users configure
- Has an Outputs schema defining what it exposes to other resources
- Implements lifecycle methods to handle create, update, and delete events
Config and Outputs
Both extend PydanticBaseModel with extra="forbid" to catch typos and invalid fields:
- Config: User-provided settings. Define required fields, defaults, and validation.
- Outputs: Values your resource exposes. Other resources can reference these fields.
Lifecycle Methods
Every resource implements three async methods:| Method | Called When | Returns |
|---|---|---|
on_create | Resource is first provisioned | Outputs |
on_update | Configuration changes | Outputs |
on_delete | Resource is removed | None |
Prerequisites
Before building a provider, you need:- Python 3.13+ - Providers use modern Python features
- uv - Fast Python package manager (install via
curl -LsSf https://astral.sh/uv/install.sh | sh) - pragma-sdk - The SDK provides
Provider,Resource,Config, andOutputsclasses - Pragmatiks CLI - For initializing projects and deploying (
pragma providers init)
Project Structure
Initialize a provider project:Testing Locally
The SDK includesProviderHarness for testing lifecycle methods without deploying:
Deploying
Once your provider is ready:What’s Next
Follow this learning path to build and deploy your first provider:Getting Started
Build a complete provider from scratch in 15 minutes.
Config and Outputs
Design configuration schemas with validation and dependencies.
Lifecycle Methods
Implement on_create, on_update, and on_delete handlers.
Testing
Test lifecycle methods with ProviderHarness.
Deployment
Build, push, and deploy your provider.
Best Practices
Idempotency, error handling, and production patterns.