Skip to content

small-config

Python-first IaC orchestration. Run Terraform, Ansible, and shell commands as a single coherent stack — with environment isolation, secrets management, dependency ordering, and built-in HTTP smoke tests.

# config.py
from small_config import HttpTest, Project, ProjectConfig, TerraformComponent, sc

class AppConfig(ProjectConfig):
    default_env = "dev"

    def project(self, env: str) -> Project:
        infra = TerraformComponent(
            name="infra",
            vars={"project_id": "my-gcp-project", "ssh_pub_key": sc.secret("ssh_pub_key")},
        )
        return Project(
            name="my-app",
            env=env,
            components=[infra],
            tests=[
                HttpTest(
                    name="api health",
                    url=infra.output("ip", transform=lambda ip: f"http://{ip}:8000"),
                    expect_status=200,
                ),
            ],
        )

CONFIG = AppConfig()
sc build          # deploy infra + run smoke tests
sc destroy        # tear everything down
sc build -e prod  # target a different environment

Why small-config?

Problem small-config answer
Terraform alone can't run Ansible or call APIs Components chain together with depends_on
Copy-pasted shell scripts per environment --env flag + per-env state files
Secrets leaking into state or logs sc.secret() — never written to disk
"Did that destroy actually work?" Locks + audit log + gcloud/curl verification via HttpTest
Too much YAML/HCL config to maintain Pure Python — reuse functions, loops, conditions

Install

Requires Python 3.14+ and uv.

uv add small-config

Then scaffold a project:

sc init

This writes config.py (edit it to describe your stack) and updates .gitignore.

Next steps