package
1.12.0-alpha20250213
Repository: https://github.com/hashicorp/terraform.git
Documentation: pkg.go.dev
# Functions
CheckValidImport returns nil if the "new" snapshot can be imported as a successor of the "existing" snapshot without forcing.
DefaultIntermediateStatePersistRule is the default implementation of [IntermediateStateConditionalPersister.ShouldPersistIntermediateState] used when the selected state manager doesn't implement that interface.
Export retrieves the latest state snapshot from the given manager, including its metadata (serial and lineage) where possible.
Import loads the given state snapshot into the given manager, preserving its metadata (serial and lineage) if the target manager supports metadata.
LockWithContext locks the given state manager using the provided context for both timeout and cancellation.
Migrate writes the latest transient state snapshot from src into dest, preserving snapshot metadata (serial and lineage) where possible.
NewFilesystem creates a filesystem-based state manager that reads and writes state snapshots at the given filesystem path.
NewFilesystemBetweenPaths creates a filesystem-based state manager that reads an initial snapshot from readPath and then writes all new snapshots to writePath.
NewFullFake returns a full state manager that really only supports transient snapshots.
NewLineage generates a new lineage identifier string.
NewLockInfo creates a LockInfo object and populates many of its fields with suitable default values.
NewStateFile creates a new statefile.File object, with a newly-minted lineage identifier and serial 0, and returns a pointer to it.
NewTransientInMemory returns a Transient implementation that retains transient snapshots only in memory, as part of the object.
NewUnlockErrorFull returns a state manager that is useful for testing errors (mostly Unlock errors) when used with the clistate.Locker interface.
PlannedStateUpdate is a special helper to obtain a statefile representation of a not-yet-written state snapshot that can be written later by a call to the companion function WritePlannedStateUpdate.
RefreshAndRead refreshes the persistent snapshot in the given state manager and then returns it.
TestFull is a helper for testing full state manager implementations.
TestFullInitialState is a state that should be snapshotted into a full state manager before passing it into TestFull.
WriteAndPersist writes a snapshot of the given state to the given state manager's transient store and then immediately persists it.
WritePlannedStateUpdate is a companion to PlannedStateUpdate that attempts to apply a state update that was planned earlier to the given state manager.
# Constants
SnapshotEqual indicates that two snapshots have a common lineage and the same serial value.
SnapshotLegacy indicates that one or both of the snapshots does not have a lineage at all, and thus no comparison is possible.
SnapshotNewer indicates that two snapshots have a common lineage and that the first has a higher serial value.
SnapshotOlder indicates that two snapshots have a common lineage and that the first has a lower serial value.
SnapshotUnrelated indicates that two snapshots have different lineage and thus cannot be meaningfully compared.
# Structs
Filesystem is a full state manager that uses a file in the local filesystem for persistent storage.
No description provided by the author
LockDisabled implements State and Locker but disables state locking.
LockError is a specialization of type error that is returned by Locker.Lock to indicate that the lock is already held by another process and that retrying may be productive to take the lock once the other process releases it.
LockInfo stores lock metadata.
SnapshotMeta contains metadata about a persisted state snapshot.
# Interfaces
Full is the union of all of the more-specific state interfaces.
IntermediateStateConditionalPersister is an optional extension of [Persister] that allows an implementation to tailor the rules for whether to create intermediate state snapshots when Terraform Core emits events reporting that the state might have changed.
Locker is the interface for state managers that are able to manage mutual-exclusion locks for state.
Migrator is an optional interface implemented by state managers that are capable of direct migration of state snapshots with their associated metadata unchanged.
OutputReader is the interface for managers that fetches output values from state or another source.
Persistent is a union of the Refresher and Persistent interfaces, for types that deal with persistent snapshots.
PersistentMeta is an optional extension to Persistent that allows inspecting the metadata associated with the snapshot that was most recently either read by RefreshState or written by PersistState.
Persister is the interface for managers that can write snapshots to persistent storage.
Reader is the interface for managers that can return transient snapshots of state.
Refresher is the interface for managers that can read snapshots from persistent storage.
Storage is the union of Transient and Persistent, for state managers that have both transient and persistent storage.
Transient is a union of the Reader and Writer interfaces, for types that deal with transient snapshots.
Writer is the interface for managers that can create transient snapshots from state.
# Type aliases
SnapshotMetaRel describes a relationship between two SnapshotMeta values, returned from the SnapshotMeta.Compare method where the "first" value is the receiver of that method and the "second" is the given argument.