Skip to main content

nf.backends.consul

Consul backend implementations for Netherframe Infrastructure as Code framework.

Installation

pip install netherframe.backends.consul

The backend uses py-consul. If upgrading an environment that has python-consul installed, remove the old distribution first: both packages install the consul Python module. Reinstalling the backend restores any shared files removed with it:

python -m pip uninstall python-consul
python -m pip install --upgrade --force-reinstall netherframe.backends.consul

In this workspace, uv sync removes the old distribution and installs the replacement from the updated lock file.

Usage

from nf.backends.consul import ConsulBackend, ConsulStateBackend

# For Terraform synthesis mode
backend = ConsulBackend(nf_scope=stack, address="consul.example.com:8500", path="terraform/myapp/state", scheme="https")

# For native execution mode
state_backend = ConsulStateBackend(address="consul.example.com:8500", path="terraform/myapp/state", access_token="your-consul-token")

Features

  • Consul KV-based state storage
  • Compatible with Terraform's consul backend
  • Support for ACL tokens
  • State locking using Consul sessions
  • Automatic session renewal and TTL management, and force-unlock by lock ID (nf state force-unlock)
  • Conditional writes: a write replaces only the state version its run read (check-and-set on the ModifyIndex)
  • Pre-apply checkpoints kept beside the state (<path>.checkpoints/)

Real-server tests

The integration contract tests use a unique KV prefix per test and remove it afterward. Point them at a test Consul server with KV and session permissions:

uv run pytest backends/netherframe.backends.consul/tests/test_consul_real_integration.py -n 0 \
  --nf-consul-test-address 127.0.0.1:8500

For an ACL-protected HTTPS endpoint, also give --nf-consul-test-scheme https and --nf-consul-test-token-file (a file containing the ACL token), and set REQUESTS_CA_BUNDLE to the trusted CA certificate file. The migration was validated against Consul 1.22 over HTTP and HTTPS with ACL enforcement.

Metadata

Release files for netherframe.backends.consul 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netherframe.backends.consul 0.5.0
File Size Uploaded Provenance Actions
netherframe_backends_consul-0.5.0.tar.gz 7.9 kB Without provenance Details for netherframe_backends_consul-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for netherframe.backends.consul 0.5.0
File Interpreter ABI Platform Actions
netherframe_backends_consul-0.5.0-py3-none-any.whl Python 3 none any Details for netherframe_backends_consul-0.5.0-py3-none-any.whl

Total release size: 19.3 kB

Release files / netherframe_backends_consul-0.5.0.tar.gz

Download URL netherframe_backends_consul-0.5.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8545c3244c9a394795d4cf4c619b19cd6d0d3ad5910b5a2528ebd91fc396032c
BLAKE2b-256 checksum
How to use checksums
3b57245b600199d154309a9d4ca3e058dabc0946506c0bd1cfd5fda0142053b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / netherframe_backends_consul-0.5.0-py3-none-any.whl

Download URL netherframe_backends_consul-0.5.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0480778645ab79657be7c76f70e5632301f0481de0d0e43daed2855ae17cfe7b
BLAKE2b-256 checksum
How to use checksums
7993d4e85ab87d58e93de2930af1efbc9b1b8ca5a15a99cde1e9162113e7b1c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for netherframe.backends.consul 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page