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.4.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.4.0
File Size Uploaded Provenance Actions
netherframe_backends_consul-0.4.0.tar.gz 7.9 kB Without provenance Details for netherframe_backends_consul-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 19.3 kB

Release files / netherframe_backends_consul-0.4.0.tar.gz

Download URL netherframe_backends_consul-0.4.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a36cfa456933cd9cd2bc8e8bdece4c3b02fac66d3acd1905701b900ed242a047
BLAKE2b-256 checksum
How to use checksums
1a3d0a39b38acfa3d6efea01241addb6ff9c2ddb62aa3e3658c86213b9a848cf
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.4.0-py3-none-any.whl

Download URL netherframe_backends_consul-0.4.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c2cc2d4e51d9db5d93b6eacbd3dcb4f208f61d19c5afdd8106c335bc84c4780
BLAKE2b-256 checksum
How to use checksums
30dbc6712bd80773f6464acbcb3e20ec0474a1fb174bbcf8a892ab7162b851b5
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.4.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