Skip to main content

Infrastructure as Code command line utility designed for cloudops engineers

Project description

iac

iac is a deterministic, serial runbook CLI for infrastructure and operations automation.

Current release: 0.1.0a1 (alpha).

Core Commands

  • iac init book <name>
  • iac list books|steps --output table|json|yaml
  • iac get book <ref> --output table|json|yaml
  • iac get step <book@step> --output table|json|yaml
  • iac check book <ref> --output table|json|yaml
  • iac deps install <ref> [--apply] --output table|json|yaml
  • iac run cmd <command>
  • iac run book <ref>
  • iac run step <book@step>

Run execution supports:

  • one-off command execution with stdin helpers: --stdin-file, --stdin-text, --stdin-json, --stdin-env
  • command argv mode: --no-shell with repeatable --arg
  • stdout/stderr file management: --stdout-file, --stderr-file, --file-mode
  • step selection controls: --from-step, --to-step, --only-step, --skip-step, --tag
  • timeout override: --timeout
  • retry overrides: --retries, --retry-delay

Runbook Schema (v1)

Top-level keys:

  • version
  • name
  • title
  • description
  • tags
  • vars
  • requires
  • sensitive
  • hooks
  • steps

Step command modes are mutually exclusive:

  • argv (explicit tokens)
  • shell (inline shell block/string)
  • script (resolved script file path)

Vars

vars is the single parameter surface.

Override precedence:

  1. book.vars
  2. IAC_VARS (k=v,k2=v2 or whitespace-separated)
  3. IAC_VAR_* (example: IAC_VAR_AWS_REGION=us-east-1 maps to aws_region)
  4. repeated --var key=value

Templating:

  • {{ var_name }} for vars
  • ${ENV_NAME} for host environment passthrough in any YAML string

Script resolution directories can be configured via:

  • IAC_SCRIPT_DIRS (preferred)
  • IAC_SCRIPTS_DIRS (alias)

Defaults include ./scripts, ./.iac/scripts, ~/.iac/scripts, and ..

Sensitive

sensitive is a list of var keys. Values for those keys are redacted from command display, console output, artifact logs, and reports.

sensitive:
  - api_token
  - aws_secret_access_key

Requires

requires declares executable dependencies and optional install hints.

requires:
  - name: tofu
    min_version: ">=1.8.0"
    check: "tofu version"
    install:
      darwin: "brew install opentofu"
      ubuntu: "apt-get update && apt-get install -y opentofu"

Supported install target keys: darwin, ubuntu, debian, redhat, rhel, fedora, alpine, arch, amzn, windows.

Failure Policy

Step on_fail and hook on_fail are both standardized to:

  • halt: stop execution immediately
  • warn: continue, emit warning
  • pass: continue quietly (non-blocking failure)

Step Execution Controls

Each step can define:

  • timeout (seconds, > 0)
  • retries (integer, >= 0)
  • retry_delay (seconds, >= 0)

iac run reports include attempt counts (ATTEMPTS) and prints a failure summary with a rerun hint when a hard failure occurs.

Packaging

pyproject.toml is configured for explicit package discovery with:

[tool.setuptools.packages.find]
include = ["iac*"]

This avoids accidental inclusion of books/ as a Python package.

PyPI Publishing

This project is configured for release publishing with GitHub Actions in:

  • .github/workflows/publish-pypi.yml

Release flow:

  1. Create/publish a GitHub release.
  2. Workflow runs tests, builds sdist/wheel, validates with twine check.
  3. On release events, package is published to PyPI via trusted publishing.

Prerequisite:

  • Configure PyPI trusted publisher for this GitHub repository and workflow in the PyPI project settings.

Known Limitations (Alpha)

  • Coverage gate is enforced at 100% for the alpha-tested scope defined in pyproject.toml coverage omit rules.
  • iac run cmd JSON/YAML output is structured, but command stdout/stderr still stream unless --quiet is set.
  • Dependency install commands in requires.install are advisory; they execute exactly as declared when iac deps install --apply is used.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iac-0.1.0a2.tar.gz (49.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iac-0.1.0a2-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

Details for the file iac-0.1.0a2.tar.gz.

File metadata

  • Download URL: iac-0.1.0a2.tar.gz
  • Upload date:
  • Size: 49.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for iac-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 6862a51139f0d5d5ff1cc89b44a9d11a09c85e6cc141584dd8e33641cd6b5b64
MD5 7f86c85cffcf45239f059044c3434198
BLAKE2b-256 16fbe733577ba0eecb1a62cdf6c0818aaeb48287147cbca3c766ce5b4636c701

See more details on using hashes here.

Provenance

The following attestation bundles were made for iac-0.1.0a2.tar.gz:

Publisher: publish-pypi.yml on pyplines/iac

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iac-0.1.0a2-py3-none-any.whl.

File metadata

  • Download URL: iac-0.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 52.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for iac-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 ad289aebbd3227476540ef63534c2359aed1854bec0018195122a530ac5e7255
MD5 cf2ac298c0d85f83a26a6432f95d7b7d
BLAKE2b-256 c3763d9541acbb1db1044207e5b7bb3dcbf7cbdce13c163422810d45dd38cc65

See more details on using hashes here.

Provenance

The following attestation bundles were made for iac-0.1.0a2-py3-none-any.whl:

Publisher: publish-pypi.yml on pyplines/iac

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page