Skip to content
INTENTIUSPublic

About

OpenTofu with per-resource locking.

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Latest commit

 

History

41,057 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

choudoufu

Go Reference

Per-resource locking for OpenTofu.

The engine terragucci can run with binary: choudoufu.

Each resource carries its identity as a marker the platform can select on. On AWS that is two resource tags. The apply writes the marker and the next plan reads it back live. The state file becomes a cache you may lose. The policy engine you already run decides who may read or change each resource.

Your OpenTofu or Terraform configuration runs as it is, and Undo returns the estate to your own backend. chant and terragucci can run choudoufu as their engine.

It runs on four platforms:

Platform Marker
AWS two tags, scoped by IAM tag conditions
Kubernetes one label, fenced by one admission policy
GCP two labels, one project per estate
Azure two tags, scoped by resource groups and Azure Policy

Three things persist between runs. A tag on the resource says which real resource an address refers to. Values with no home in AWS go in a record_store, which is a local directory by default. It can instead be a Kubernetes namespace you own or an object store you own (S3, GCS or Azure Blob). Effects with nothing to read back get a receipt that tracks their staleness.

AWS already scopes IAM by tag. choudoufu derives each marker from the configuration address and writes it in the create call, so every resource that exists carries one. Your IAM is the permission model.

No lock is held across a run. A race between two runs ends in a re-plan or a named collision, except that two plain applies changing one attribute are last-writer-wins at the cloud API. apply <planfile> refuses, before any change, if the live system moved since approval. Separate estates need no coordination (CONCURRENCY.md). For concurrent applies inside one estate, terragucci holds each resource a wave changes.

Whoever inherits an estate can list it with any cloud tool before running the binary.

Handover is granting a role. Adoption and renames are tag writes.

The name means stinky tofu, an acquired taste that suits a fork whose state may go stale.

Built on OpenTofu 1.14.0-dev (fork point aa3eb66a0c). The exact upstream version lives in version/VERSION, and each release's notes name both. Live markers are the only change from the stock release.

Where this stands

Most commonly used AWS resource types are admitted. aws_lambda_permission takes no tags, so it is declaration-carried: its identity is recomputed from the configuration on every run.

Some constructs stop a configuration more often than types do. One example is count.index in a resource argument, and another is a child module call. A backend block does not stop one. It is ignored with a warning. An s3, gcs or azurerm backend holds the records when no record_store is declared, so keep it. A saved plan file (-out plus apply <planfile>) works: the apply re-reads the live system and refuses by name if it differs from the approved file (#878).

For a verdict on your own code, run this in your configuration directory. It runs offline.

choudoufu live-check

Will my config work? covers the same ground. live/LIMITATIONS.md lists every limit with its reasoning.

Try it

The smoke stack is the demo and the test suite. One docker compose stack runs the pinned emulator and a stock tofu oracle. Each step prints a verdict line, and the run exits 0 when every step passed. A scenario needs Docker and takes about two minutes.

just smoke roundtrip    # stock estate -> live-import -> no state file -> back to stock
just smoke             # lists every scenario

Or paste this to a coding agent:

Clone https://github.com/INTENTIUS/choudoufu, then do the following.

1. Confirm Docker is running (`docker info` must succeed) and the AWS CLI
   is installed (`aws --version`).
2. If Go is installed, skip this step. Otherwise pick the latest release
   tag from https://github.com/INTENTIUS/choudoufu/releases and
   export CHOUDOUFU_VERSION=<that tag> so the smoke runs a prebuilt binary.
3. From the repo root, run: just smoke roundtrip
4. Report each step's verdict line as it prints, and the final PASS or
   FAIL line.

BREAK=1 corrupts one expected fact mid-scenario, and the scenario passes only by catching it. live/smoke/README.md has every knob.

Install

Every tagged release publishes binaries for macOS and Linux. Windows binaries are published too, and each platform has amd64 and arm64 builds. A SHA256SUMS file sits on the releases page. This fetches the latest on macOS or Linux.

os=$(uname -s | tr '[:upper:]' '[:lower:]')
arch=$(uname -m | sed 's/x86_64/amd64/; s/aarch64/arm64/')
gh release download -R INTENTIUS/choudoufu --pattern "*_${os}_${arch}.tar.gz"
tar xzf choudoufu_*_"${os}"_"${arch}".tar.gz   # unpacks ./choudoufu

On Windows (use *_windows_arm64.zip on ARM64):

gh release download -R INTENTIUS/choudoufu --pattern "*_windows_amd64.zip"
Expand-Archive choudoufu_*_windows_amd64.zip .   # unpacks .\choudoufu.exe

Which path is yours

If AWS already holds resources your configuration manages, read Migrate an existing estate. Write the markers before the first apply; an early apply creates a duplicate beside the real resource.

For a new estate, read Start a new estate. It is a live block and an apply.

Building and testing

go build ./cmd/choudoufu
go test ./...

The integration tier needs Docker and TF_FLOCI_TEST=1.

Docs

The user guides live at https://intentius.io/choudoufu/. The repository holds the specs. live/MARKERS.md covers marker tags and live/LIMITATIONS.md covers every bounded construct. live/RECEIPTS.md covers receipts. The demo harness is in live/e2e/README.md.

The upstream documentation lives at opentofu.org.

a pixel-art block of dark fried tofu

License

choudoufu is licensed MPL-2.0, forked from opentofu/opentofu at aa3eb66a0c. LICENSE and all copyright headers match upstream.

choudoufu is not affiliated with or endorsed by OpenTofu or the Linux Foundation. OpenTofu is a registered trademark of the Linux Foundation.

About

OpenTofu with per-resource locking.

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages