Metadata-Version: 2.4
Name: netherframe.backends.remote
Version: 0.5.0
Summary: Terraform Cloud/Enterprise backend implementations for Netherframe
Author: Sourabh Cheedella
Author-email: Sourabh Cheedella <cheedella.sourabh@gmail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Systems Administration
Requires-Dist: netherframe-core>=0.14.0,<1.0.0
Requires-Dist: requests>=2.34.2
Requires-Dist: pytest>=9.2.0 ; extra == 'dev'
Requires-Python: >=3.15
Project-URL: Homepage, https://netherframe.arsenal.sh
Project-URL: Repository, https://github.com/arsenal-sh/netherframe
Provides-Extra: dev
Description-Content-Type: text/markdown

# nf.backends.remote

Terraform Cloud/Enterprise backend implementations for Netherframe Infrastructure as Code framework.

## Installation

```bash
pip install netherframe.backends.remote
```

## Usage

```python
from nf.backends.remote import RemoteBackend, RemoteStateBackend

# For Terraform synthesis mode
backend = RemoteBackend(nf_scope=stack, organization="my-org", workspaces={"name": "my-app-prod"})

# For native execution mode
state_backend = RemoteStateBackend(hostname="app.terraform.io", organization="my-org", workspaces={"name": "my-app-prod"}, token="your-api-token")
```

## Features

- Terraform Cloud/Enterprise integration
- Compatible with Terraform's remote backend
- API-based state management: state is stored as workspace state versions and
  locked with the workspace lock
- Workspaces are selected by `name`, or by `prefix` plus `TF_WORKSPACE`
- Conditional writes: a state version is uploaded only while the workspace's state is the one the run read
- Force-unlock of the workspace (its lock ID is the workspace ID); pre-apply checkpoints are state versions, which HCP Terraform keeps

`RemoteStateBackend` keeps Netherframe's state under a `netherframe` key of an
otherwise empty Terraform state document, so Terraform itself does not see the
resources in that workspace. Loading a workspace whose state was written by
Terraform raises an error instead of silently returning empty state.
