Example Contracts

This section provides ready-to-use Pacto contracts for common infrastructure services. Use these as references when writing your own contracts or as dependencies in your service contracts.


Table of contents

These contracts represent the operational interface of each service — not a deployment recipe. They describe what the service exposes, how it behaves, and what the platform needs to know.


Available examples

Service Type State Description
PostgreSQL service stateful/persistent Relational database
Redis service stateful/persistent In-memory data store
RabbitMQ service stateful/persistent Message broker
NGINX service stateless/ephemeral Reverse proxy / web server
Cron Worker scheduled stateless/ephemeral Scheduled batch job

Using examples as dependencies

You can reference these contracts (once published to a registry) as dependencies in your own pacto.yaml:

dependencies:
  - ref: ghcr.io/acme/postgres-pacto@sha256:abc123
    required: true
    compatibility: "^16.0.0"

  - ref: ghcr.io/acme/redis-pacto@sha256:def456
    required: false
    compatibility: "^7.0.0"

Then use pacto graph to visualize the full dependency tree:

pacto graph pacto.yaml

Table of contents