State
Yaffle fully manages OpenTofu state. You don’t configure backends, set up buckets, or manage lock tables. State storage and locking are handled automatically.
How it works
Section titled “How it works”When Yaffle runs OpenTofu, it configures the backend automatically. Any backend configuration in your code is ignored during Yaffle runs.
terraform { # This block is ignored by Yaffle # Yaffle manages state for all runs it executes backend "s3" { bucket = "my-existing-bucket" key = "terraform.tfstate" }}State isolation
Section titled “State isolation”Each environment and preview gets isolated state. Environment names are completely up to you—use whatever fits your workflow:
| Context | State isolation |
|---|---|
Named environment (e.g. prod, staging, eu-west) | Dedicated state per workspace |
| Preview (PR #42) | Ephemeral state, destroyed with PR |
Preview state is completely isolated from named environments. A bug in a preview can’t corrupt your other environments’ state.
Locking
Section titled “Locking”Yaffle prevents concurrent modifications. If two commits push simultaneously, runs are queued and executed sequentially.
Lifecycle
Section titled “Lifecycle”| Event | State action |
|---|---|
| PR opened | State created on first apply |
| PR updated | State updated |
| PR merged/closed | State destroyed with resources |
| Push to trigger branch | Named environment state updated |
Security
Section titled “Security”- Encrypted at rest
- Encrypted in transit
- Isolated per organization
- No customer access to raw state files
Viewing state
Section titled “Viewing state”The Yaffle dashboard shows:
- Resource counts per workspace
- Last modified timestamps
- Drift detection (planned)
For debugging, use tofu show output in run logs rather than accessing state directly.
Migrating existing state
Section titled “Migrating existing state”If you have existing state you want Yaffle to manage:
- Import your OpenTofu/Terraform directory as a workspace
- Yaffle runs
tofu planagainst empty state - Use
tofu importcommands to bring resources under management
Or continue managing existing infrastructure separately and use Yaffle for new workspaces.