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.3.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.3.0
File Size Uploaded Provenance Actions
netherframe_backends_consul-0.3.0.tar.gz 7.9 kB Without provenance Details for netherframe_backends_consul-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 19.3 kB

Release files / netherframe_backends_consul-0.3.0.tar.gz

Download URL netherframe_backends_consul-0.3.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bda13a8238f8fb238ec18c2d692b628979ac21e1893125133ea60f3b385ac1c5
BLAKE2b-256 checksum
How to use checksums
fdd5c74c7c221a2bfd41f569acfe209eac8e4f5d9fb948be31b10515789491fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.3.0-py3-none-any.whl

Download URL netherframe_backends_consul-0.3.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b55fcb5e5ce73dcc9203261a6dc09d937d7d9b112b396ae510201379a57c6fc
BLAKE2b-256 checksum
How to use checksums
4960cde4e1456c92045436a8cf8cd78623544dda24b2527bae84435364701f2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.3.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