OpenTofu
An open-source infrastructure as code tool, written in Go. It reads declarative configuration, plans changes and applies them to cloud and other providers, tracking the result in state. Maintained by the OpenTofu project, under the Linux Foundation.
Business rules, traced to source lines.
These 11 rules are a sample of the 18,979 CoreStory V3 extracted from OpenTofu. Each one links to the exact lines on GitHub at commit 3967c69. The statement is CoreStory V3’s wording; the code excerpt is the source it cites.
When the enforced flag is true, if any resolved method in the collected methods is configured as unencrypted (unencrypted.IsConfig(m)), the function returns nil methods and appends an error diagnostic "Unencrypted method is forbidden" with detail "Unable to use unencrypted method since the enforced flag is set."
- true — enforced flag value triggering the prohibition
Also cited: L17
If both the encrypted state and the decrypted state have a non-nil `serial` field, their values must be equal; otherwise decryption returns the error "invalid state metadata, serial field mismatch %v vs %v" with the encrypted serial first and decrypted serial second. The check is skipped when either serial is nil (to support alpha1 states).
- serial — JSON field name whose values are compared
- invalid state metadata, serial field mismatch %v vs %v — error message on mismatch
Also cited: L67–L70
When a decryption key is present (length greater than 0), it must also be exactly 16, 24, or 32 bytes long; otherwise configuration is rejected with ErrInvalidConfiguration stating the valid lengths and the received byte count. An empty decryption key is exempt from the length check.
- 16 bytes — permitted AES-128 decryption key length
- 24 bytes — permitted AES-192 decryption key length
- 32 bytes — permitted AES-256 decryption key length
- 0 bytes — decryption key length threshold below which the length check is skipped
Also cited: L19
The count meta-argument value must be between 0 and maxCount (int64(math.MaxInt32) = 2147483647), inclusive; if the int64 conversion is not exact or the value exceeds maxCount, an error 'must be between 0 and %d, inclusive' is produced.
- 0 — lower bound of permitted count range
- 2147483647 — upper bound of permitted count range
- must be between 0 and %d, inclusive — error message format for out-of-range count
Also cited: L28
Ephemeral resources cannot be used as sources or targets for the move action; if addrFrom.Resource.Mode or addrTo.Resource.Mode equals addrs.EphemeralResourceMode, validateResourceMove fails with error "Invalid state move request" and message "Ephemeral resources cannot be used as sources or targets for the move action. Just update your configuration accordingly."
- Invalid state move request — error summary
- Ephemeral resources cannot be used as sources or targets for the move action. Just update your configuration accordingly. — error detail
Also cited: L500–L502
When a provider returns a value for a resource, any write-only attribute path discovered from the schema must yield a null value; if the value at that path is not null, an hcl.Diagnostic with Severity hcl.DiagError, Summary "Invalid provider response", and Detail "Resource type %q returned an actual value for the write-only attribute %q while it is meant to be nil. This is an issue in the provider SDK." is appended. If the schema contains no write-only attributes, validation returns no diagnostics. If applying the path to the value yields an error, the check logs a warning and skips that path; if the value is null, the check skips that path.
- Invalid provider response — diagnostic summary
- Resource type %q returned an actual value for the write-only attribute %q while it is meant to be nil. This is an issue in the provider SDK. — diagnostic detail format
- [WARN] Error when trying to get the path (%s) value from the given object: %s — warning log format for path apply errors
Exactly one of the "inline", "script", or "scripts" attributes must be set; if the number of non-null attributes among these three differs from 1, an error diagnostic with summary "Invalid remote-exec provisioner configuration" and detail `Only one of "inline", "script", or "scripts" must be set` is appended.
- 1 — required count of set (non-null) attributes among inline, script, scripts
- inline — attribute name counted as a script source
- script — attribute name counted as a script source
- scripts — attribute name counted as a script source
Also cited: L46–L57
The command line mirror options -fs-mirror, -net-mirror, and -oci-mirror are mutually exclusive: at most one of FsMirrorDir, NetMirrorURL, and OciMirrorTemplate may be non-empty, otherwise an error diagnostic "Invalid installation method options" / "The mirror command line options are mutually-exclusive." is produced.
- -fs-mirror — mirror option name whose non-empty value counts toward exclusivity
- -net-mirror — mirror option name whose non-empty value counts toward exclusivity
- -oci-mirror — mirror option name whose non-empty value counts toward exclusivity
- Invalid installation method options — error summary when more than one mirror option is set
- The mirror command line options are mutually-exclusive. — error detail when more than one mirror option is set
If a declared variable was not given a value in either the declared-values result or the undeclared-values result and vc.Required() is true, an error diagnostic 'No value for required variable' is emitted with the message that the root module input variable is not set and has no default value, and a placeholder InputValue with Value cty.DynamicVal, SourceType tofu.ValueFromConfig, and SourceRange from vc.DeclRange is recorded.
- tofu.ValueFromConfig — source type assigned to the required-variable placeholder and unset placeholder
Also cited: L174–L177
The attribute names count, depends_on, and source are reserved in provider blocks; if any such attribute is present, an error diagnostic "Reserved argument name in provider block" is emitted indicating the name is reserved for use by OpenTofu in a future version.
- count — reserved provider attribute name
- depends_on — reserved provider attribute name
- source — reserved provider attribute name
If the same key provider config is encountered again in the current setup stack, loading fails with error diagnostic "Circular reference detected" and detail "Cannot load %s due to circular reference between key providers. Stack trace %s", using the key provider address and the stack trace rendered with " -> " separators.
- Circular reference detected — diagnostic summary for a circular key provider reference
- Cannot load %s due to circular reference between key providers. Stack trace %s — diagnostic detail format for a circular key provider reference
- -> — separator used when joining the key provider stack trace
Also cited: L294–L307
What the application does
21 capabilities identified, grouping 193 of the 3,071 distinct features extracted. Most extracted features are not grouped under a capability, so this list is a partial view of the application. These are descriptions, not the cited rules above.
State Management, Locking & Migration
Persisting, refreshing, locking, moving, importing, and upgrading infrastructure state across backends.
- Backend State Move: Move state between backends with source and destination addresses, a state handle, and view/vars context.
- Infrastructure State Refresh: Refreshes recorded infrastructure state to reconcile it with actual resource state before planning.
- Resource Import: The provider allows existing resources to be imported into state by identifier.
- Resource Import and State Movement: Import existing resources into state and move resources between states.
- Resource Move: Users can move a resource from a source location to a target, with validation and command-based execution.
- Resource Move (Refactoring): Relocate resources, resource instances, and modules between addresses during configuration refactoring.
- Resource Move Handling: Applies configured and recorded resource address moves so state is relocated without destroying resources.
- Resource State Import: Import existing infrastructure into Terraform state by its type and id.
- Resource State Move: Move a resource address in state from a source to a destination, with dry-run preview and final status reporting.
- Resource State Upgrade: Stored resource and identity state is upgraded from prior schema versions when schemas evolve.
- State File Format Read/Write: Reading and writing versioned state files in V4 format, including their JSON serialization.
- State Locking: Acquire, inspect, and release a named lock to prevent concurrent state operations.
- State Management: Manages stored infrastructure state with locking and dependency locks.
- State Migration: Read and write state versions to support migration and upgrades of remote state.
- State Persistence: Capability to persist and retrieve operational state via Get, Put, and Delete operations.
- State Refresh: Refreshes resource state, emitting start and completion notifications for the refresh operation.
- State Serialization: Resources and data are exchanged with clients in multiple encoding formats including JSON and MessagePack dynamic values.
- State Serialization and Persistence: Reading and writing application state to persistent storage with versioning and round-trip fidelity.
- Terraform State Management: Build, query, and manipulate Terraform state including its root module, child modules, resources, resource instances, and outputs.
- Terraform State Serialization: Serializes Terraform state, modules, resources, and outputs into a structured JSON representation for storage or transport.
Infrastructure Provisioning & Resource Lifecycle
Declarative definition, planning, applying, reading, and destruction of managed infrastructure resources across their create/update/destroy lifecycle.
- AWS Instance Provisioning: Defines and provisions an AWS EC2 instance resource with its AMI, security groups, and organization tagging.
- Apply Changes: Applies a change plan, emitting human-readable, JSON, or multiple outputs after the operation.
- Apply Plan: Apply a planned set of changes to infrastructure, creating, updating, and destroying resources and modules.
- Change Application: Applies planned changes to resources and reports apply start, progress, completion, and error states.
- Cloud Infrastructure Provisioning: Provisions cloud infrastructure resources such as compute instances, load balancers, security groups, and floating IPs.
- Infrastructure Provisioning: Declarative provisioning of infrastructure resources through containers and providers across regions and sources.
- Resource And Data Source Read: Retrieve current state for an existing managed resource or compute a data source's values.
- Resource Apply: Apply planned changes to create, update, or delete real infrastructure.
- Resource Change Application: The provider applies a planned resource change to produce the new resource state.
- Resource Change Apply: Capability to apply a planned resource change to reach desired state.
- Resource Declaration: Defines a managed resource with its local name and content, forming the unit of infrastructure state that users author and apply.
- Resource Destroy: Destroy resources and modules, including nested modules, orphans, and dependency-ordered teardown.
- Resource Lifecycle Management: Providers manage the full lifecycle of managed resources, from configuration validation and planning through applying changes, reading state, and importing existing resources.
- Resource Provisioning: Starts, provides, and tears down provisioned resources on demand.
- Resource Read: Capability to read the current state of a managed resource.
- Resource State Read: Clients read the current state and identity of an existing resource.
- Resource State Refresh: Read the current remote state of a managed resource.
- Resource and Data Source Reading: Read the current state of managed resources and data sources.
- Terraform Apply: Executes a plan to apply infrastructure changes, supporting saved plan files, variable files, workspace selection, parallelism, targeting, replacement, refresh, and backup options.
Provider Plugin Integration & Schema Discovery
Discovering providers and their schemas, configuring provider instances, and exchanging capability information across the plugin protocol.
- Client Capability Negotiation: Clients advertise capabilities such as deferral and write-only attribute support during provider communication.
- Provider Configuration: The provider is configured with endpoint/credentials data before use, with its configuration validated.
- Provider Configuration Parsing: Parses and decodes Terraform provider configuration blocks, including provider source addresses and provider requirements.
- Provider Configuration and Lifecycle: Capability to configure a provider and perform its lifecycle operations such as stop and cleanup.
- Provider Configuration and Validation: Clients configure the provider and validate the provider configuration before use.
- Provider Discovery: Discovering and exposing the set of available providers and their schema to callers.
- Provider Function Invocation: Users invoke provider-defined functions from their configuration, with the available functions discoverable via GetFunctions.
- Provider Functions: Providers can expose callable functions that users invoke with parameters and receive return values or errors.
- Provider Installation: Downloads and installs providers, including retry handling for failed downloads.
- Provider Lifecycle Management: Instantiate and shut down the provider instance.
- Provider Plugin Lifecycle: The provider plugin can be started, stopped, and served over gRPC for client connections.
- Provider Registration: Allows providers to be registered and recognized within a library, enabling discovery of provider schemas.
- Provider Schema Discovery: The provider exposes its resource and data source schemas so the client can understand available configuration options.
- Schema and Metadata Discovery: Expose the provider's schemas, functions, and metadata so clients can discover available resources and data sources.
- Terraform Provider Plugin Protocol: A gRPC plugin surface exposing the full Terraform provider lifecycle — schema discovery, provider/resource/data-source validation and configuration, planning, applying, reading, importing, state upgrade/move, ephemeral resources, and function retrieval — to Terraform Core.
Backend & Remote State Storage
Configuring and operating remote backends and storage services for state, including S3, GCS, Azure, Consul, and HTTP backends.
- Azure Storage Provisioning: Provisions an Azure storage account with its container, resource group, and naming conventions.
- Backend Configuration: Configures backend connection parameters including timeouts and storage naming.
- Backend Initialization: Initializes the backend environment on startup.
- Backend Migration: Migrate or reconfigure the state backend, including deleting local state and writing the new saved backend.
- Backend State Migration: Migrates Terraform state between backend configurations, supporting single, multi, and cloud/TFC migration scenarios with confirmation prompts and destination workspace selection.
- Cloud Backend Initialization: Initializes a cloud backend with provider, module, and configuration setup for the user's infrastructure.
- Consul Remote State Backend: Enables storing and locking Terraform remote state in a Consul key-value store, configured via address, scheme, datacenter, and related settings.
- GCS Backend Storage Configuration: Lets a user configure a Google Cloud Storage backend, supplying the bucket, prefix, and encryption/KMS settings used to access it.
- HTTP Remote State Retrieval and Update: Read and write Terraform state to a remote HTTP endpoint with a configurable address and update method.
- Remote Backend Configuration: Configure a Terraform remote backend via CLI arguments, configuration variables, and example configurations.
- Remote State Storage: Store, retrieve, and delete Terraform state data in a remote backend keyed by workspace state keys.
- Remote State Storage/Backend: A remote backend capability for storing and managing Terraform state, including encrypted and prefixed variants.
- S3 Backend State Storage: Users store and protect OpenTofu state in S3 buckets with encryption, permissions, and object tagging.
Authentication & Credential Management
Authenticating users and services and resolving, storing, and validating credentials across cloud providers and registries.
- AWS Authentication and Credentials: Users authenticate to AWS via static credentials, shared config/credential profiles, or web identity tokens.
- Assume Role and Delegated Access: Users delegate access by assuming IAM roles, optionally with web identity federation.
- Authentication: Authenticates users via user, password, and URL credentials managed through an auth structure.
- Azure Authentication Configuration: Configures how the provider authenticates to Azure, supporting service principal secrets/certificates, CLI, managed identity, OIDC, and Azure AD/Workload Identity options.
- Credential Management: Manages credentials and credential helpers for accessing repositories and hosts.
- Credential Storage: A user or host can store, retrieve, and forget credentials through a credentials store helper.
- Credential Validation: Validates user-supplied username and password credentials.
- Google Cloud Authentication: Authenticates to Google Cloud using credentials, access tokens, impersonated service accounts, and universe domain selection.
- OCI Registry Authentication: Resolves appropriate credentials for OCI registry access by selecting among available credential sources based on specificity.
- Role Assumption: Allows a caller to assume an IAM role by supplying a role ARN, session name, optional external ID, policy, duration, and session tags.
- User Login: Authenticates a user by parsing login input and binding it to establish an authenticated session.
- User Logout: Allows a user to log out of their session, parsing logout requests and binding logout handling to a host.
Build, Test & Release Automation
Compiling artifacts, running test suites, and publishing releases, container images, and nightly builds through the pipeline.
- Automated Test Execution: Runs the project's unit and engineering test suites as part of the pipeline.
- Build: The build targets that compile the project binaries, including an experimental variant.
- Build Docker Images: Builds and publishes container images, including docker v2 and docker sign artifacts.
- CI/CD Pipeline Configuration: Defines and authorizes a build pipeline with a service connection to Azure.
- Nightly Build: Produce nightly artifacts on a scheduled basis for downstream consumption.
- Package Release: Publishes build artifacts to distribution channels such as GitHub releases, PackageCloud, and Snapcraft.
- Project Build: Compile the project into distributable artifacts as the core build step.
- Release: Orchestrates the creation and publication of a versioned release including checksums and changelog.
- Release Publishing: Build and publish a versioned release of the project with release metadata.
- Source Checkout: Fetch source code and tags and check out the repository revision so downstream build steps have the working tree they need.
- Source Code Checkout: Fetches the repository source code as a foundation step for the build/test pipeline.
- Test Suite: General unit and integration test execution including coverage and experimental variants.
Configuration Authoring & Validation
Authoring, formatting, decoding, and validating configuration code and provider settings before operations run.
- Code Formatting: Format source files or stdin input, optionally applying edits to a directory tree.
- Config Validation: Validate configuration content and keys, reporting whether a given configuration is present and valid.
- Configuration Loading: Loads and merges configuration from files, directories, and environment variables into a unified config.
- Configuration Parsing: Parse configuration supplied as HCL or JSON into structured Config/Descriptor data for use by the system.
- Configuration Parsing and Evaluation: Parse and evaluate HCL configuration files including expression evaluation, import resolution, and variable scope handling.
- Configuration Validation: Validates configuration values to ensure they are well-formed before use.
- HCL Configuration Parsing: Ability to parse HCL configuration text into a structured configuration representation.
- Provider Configuration Validation: Validates provider configuration inputs and surfaces warnings or suggestions for invalid or unusual settings.
- Resource Config Validation: Capability to validate resource configuration before it is applied.
- Resource Configuration Validation: The provider validates the configuration supplied for a resource or data source type before use.
- Resource and Data Source Config Validation: Clients validate resource, data source, and ephemeral resource configurations prior to planning or applying.
- Terraform Configuration Parsing: Parses Terraform configuration elements such as modules, resources, data sources, outputs, locals, and input variables into usable representations.
Encryption & Key Management
Encrypting and decrypting state, plans, and payloads, and managing encryption keys from local, KMS, and vault providers.
- AWS KMS Key Management: Integrates with AWS KMS as a key provider so encryption keys can be referenced and provisioned via Terraform.
- Data Decryption: Decrypts data using a key management service.
- Data Encryption: Provides encryption capability exposed through an encryption container, with initialization logic to set it up.
- Encryption: Users can configure encryption settings including the ability to disable it.
- Encryption Key Configuration: Supports configuring customer-managed encryption and KMS keys for securing stored data.
- Encryption Key Management: Loading and configuring encryption keys from environment variables, inline values, or file paths to enable encrypted data handling.
- File Encryption: Encrypt files using configured keys via an encrypt command.
- File Encryption Service: Encrypts input files using a configured key and writes the encrypted output.
- Key Provider Registration: Allows consumers to register a key provider by ID and receive it back on demand.
- Payload Encryption: Encrypts and decrypts data payloads using configurable encryption methods with versioning and key provider metadata.
- Plan Encryption: Encrypt and decrypt plans to protect stored plan data.
- State Encryption: Persist and restore encrypted 3DS state so sensitive transaction state is stored securely at rest.
Module Installation & Composition
Declaring, downloading, installing, and composing reusable modules and their nested instances.
- Descendant Module Installation: Recursively discovers and installs descendant (nested) modules by walking the module tree.
- External Module Installation: Users can declare external modules that the system ensures are installed.
- Module Composition: Users can compose multiple modules together to build larger configurations from reusable units.
- Module Expansion: Expands a root module into the full tree of nested module instances based on repetition and expansion rules.
- Module Input Variables: Passes and validates input variables supplied to child modules, including defaults and type checks.
- Module Installation: Discover and install modules referenced by the configuration, with support for tests alongside modules.
- Module Instance Expansion: Plans module instances that may themselves expand and become orphaned or destroyed.
- Module Loading: Loads and resolves a module and its transitive child modules into memory from a source location.
- Module Refactoring: Capability for refactoring configuration, including splitting one module into multiple.
- Module Registry Browsing: Users can browse and inspect registry modules, including their metadata, versions, providers, and details.
- Module Source Parsing: Parses user-supplied module source strings into structured local, remote, or registry module sources.
- Module and Instance Expansion: Expand module calls into concrete instances by setting module call and root module arguments for evaluation.
Diagnostics, Logging & Output Rendering
Surfacing structured diagnostics, warnings, logs, and human-readable or JSON output of operations to users and callers.
- Console Output: Renders command results to the console in human, JSON, or multi formats.
- Diagnostic Reporting: Surface errors, warnings, and informational messages from operations back to the user.
- Diagnostics Reporting: Operations return structured diagnostics with severity and detail for user-facing error and warning reporting.
- Error Reporting: A set of domain error types that surface invalid, missing, or duplicate registrations of keys, key providers, and methods, unwrapping wrapped causes for diagnostics.
- Exit Code Reporting: Report detailed exit codes that communicate operation outcomes to callers and users.
- Human-Readable View Output: Render command results in a human-readable textual format.
- JSON View: Renders and exposes Terraform plan, state, and apply results as human- or machine-consumable JSON output, including diagnostics, drift, and planned change details.
- Logging: Structured logging capability with configurable log levels and outputs for users and plugins.
- Plan Diagnostics Reporting: Collects and reports RPC diagnostics arising during planning.
- Structured JSON Output: Emit command results as JSON, optionally streamed, to a named output file.
- Structured Logging: Provides configurable leveled logging with named loggers and structured key-value fields attached to log entries.
Plan Computation & Change Preview
Computing execution plans and presenting the proposed changes, diffs, and drift before anything is applied.
- Change Planning: Computes and presents the summary and details of planned changes before they are applied.
- Drift Detection and Refresh Planning: Detecting drift from the desired state and planning the corresponding move or refresh-only actions.
- Infrastructure Planning: Plan infrastructure changes by evaluating configuration expressions, blocks, and triggers with variable resolution to determine required actions.
- Plan Diff Computation: The provider computes differences between desired and current state for resources and data sources.
- Plan Display: Renders a human-readable plan showing proposed resource changes to the user.
- Plan Generation: Produces and persists an execution plan, including refreshing and outputting to a backend or file.
- Plan Generation and Review: Producing and inspecting execution plans, including plan files and no-op detection.
- Plan Output Display: Present a Terraform-style plan result showing planned values, resource changes, outputs, and configuration to the user.
- Plan Preview: Displays a rendered plan of proposed changes to the user before execution.
- Resource Change Planning: Computes and returns the planned state and any required replacements for a proposed resource change before it is applied.
- Terraform Plan Generation: Computes an execution plan by comparing desired configuration against prior state, accounting for drift and deferred changes.
Data Source Reading & Function Invocation
Reading external data sources and invoking provider-defined functions to supply computed values into configuration.
- Custom Function Compilation: Compiles user-authored custom functions for use as Terraform provider extensions.
- Data Source Config Validation: Validates data source configuration so invalid queries are rejected before execution.
- Data Source Configuration Validation: Validates data source configurations against their schemas.
- Data Source Read: The provider reads configuration and returns computed data for a data source.
- Data Source Reading: Providers expose data sources that can be configured, validated, and read to supply computed data to users.
- Data Source Reading and Validation: Capability to validate configuration and read data sources defined by the provider.
- Expression Evaluation: Evaluating expressions within a given evaluation context.
- Function Invocation: A client can discover and invoke provider-defined functions with typed arguments and parameters.
- Provider Function Invocation: Users invoke provider-defined functions from their configuration, with the available functions discoverable via GetFunctions.
- Provider Functions: Providers can expose callable functions that users invoke with parameters and receive return values or errors.
Workspace Lifecycle Management & Selection
Creating, listing, selecting, locking, and deleting workspaces as units of configuration and state.
- Local Workspace State Management: Manage Terraform workspace state stored locally, including creating, selecting, and deleting named workspaces.
- Remote Workspace Management: Create, fetch, verify, and delete workspaces on a remote TFE/HCP Terraform backend, including credential and version handling.
- Workspace Deletion: Allows a user to delete a named workspace, optionally forcing removal.
- Workspace Lifecycle Management: Provides create/read/delete operations for Terraform Cloud workspaces, exposing them as data structures and mappings.
- Workspace Listing: Enumerate workspaces for an organization or across all scopes.
- Workspace Locking: Lets users lock and unlock workspaces to control access and prevent modification.
- Workspace Management: Lists, selects, and deletes named workspaces, including the default workspace.
- Workspace Management and Selection: Users create, select, and organize workspaces with key prefixes and per-workspace IAM roles.
- Workspace Selection: Selects the Terraform or OpenTofu workspace to operate against, including non-default workspaces.
- Workspace Selection and Naming: Discovers available workspaces and prompts the user to select or name a destination workspace during backend migration.
CLI Command Surface & Configuration
Parsing command-line arguments, executing commands, and loading/merging CLI configuration from files and environment.
- CLI Argument Parsing: Parses command-line arguments into a structured configuration with default values applied.
- CLI Command Invocation: Running the command-line tool executes a selected command with parsing of arguments and flags.
- CLI Configuration: Users configure the CLI via config files and environment variables.
- CLI Initialization: Initializes the command-line interface with user-supplied options and context so the tool can be launched and run from a terminal.
- Command Execution: Users run a configured command and receive its execution result.
- Command-Line Argument Parsing: Users invoke parsing of raw arguments into structured flags and positional values.
- Command-Line Interface: Users define and parse command-line interface commands, flags, and positional arguments.
- Configuration Merging: Combines multiple configuration sources into a single effective configuration that the user or system consumes.
- Environment Variable Overrides: Allows users to override configuration settings through environment variables.
Checks, Assertions & Policy Evaluation
Evaluating user-declared conditions, assertions, check rules, and policies to validate configuration and plan conformance.
- Assertion Checking: Exposes an assert capability so that callers can verify a condition holds and receive an error message on failure.
- Check Execution: Runs configured checks against an operation to produce check results.
- Check Rule Evaluation: Associate and evaluate check rules against checkables, including invalid kind handling.
- Continuous Validation: Capability to run checks continuously during workflows so users observe validation status over time.
- Custom Conditions: Allows users to attach custom conditions with addresses and messages to resources or data blocks.
- Plan Policy Evaluation: Evaluate and surface policy check results (pass, soft fail, hard fail) during planning.
- Preconditions and Postconditions: Users can define preconditions and postconditions with error messages to assert invariants at plan/apply time.
- Preconditions and Postconditions (checks): Evaluate user-declared precondition and postcondition assertions and report failures during planning.
- Variable Validation: Evaluates custom validation rules on input variables and reports errors.
Configuration Testing & Test Plans
Authoring and running tests for configurations and modules, including test plans, fixtures, and result reporting.
- Configuration Testing: Users run tests against their configurations.
- JSON Test Result Output: Capability to produce and validate JSON-formatted test run results, including run, file, conclusion, and summary reporting.
- Module Testing: Executes test plans and runs, including cleanup, interrupts, and summary reporting of test outcomes.
- Module Testing Support: Capability to define and run test instances for Terraform module configurations.
- Running Tests: A test execution capability that runs test cases such as test_a and test_b within a test container.
- Terraform Testing: Users can write and run tests to validate their Terraform configuration.
- Test Execution: Executes an instance test, producing the observable test outcome for the given input (foo).
- Test Plan Configuration: Specifies the options, variables, and command used to drive a test run.
- Test Run Execution: Perform a configured test run, supporting distinct individual test runs with plan options.
Dependency Graph & Ordering
Building and traversing the dependency graph that orders resource and module operations and detects relationships.
- Dependency Graph Compilation: Compiles and exposes dependency information marked by dependency directives.
- Dependency Ordering: Honors depends_on relationships, create-before-destroy sequencing and taint-driven replacement.
- Directed Acyclic Graph Operations: Provides operations over a DAG including ancestor/descendent queries, root discovery, validation of acyclicity, pruning, and transitive reduction.
- Directed Graph Manipulation: Provides creation and mutation of directed graphs via adding/removing vertices and edges.
- Graph Serialization: Renders the graph to a textual/dot representation for external consumption.
- Graph Traversal: Enables walking/traversing a graph in a defined order, with handling for traversal errors.
- Resource Dependency Graph: Builds and exposes a graph of resources and their references, providers, and dependency relationships.
- Topological Ordering: Produces a topological order of a directed acyclic graph, including a reduced transitive form.
- Transitive Reduction Transformation: Applies a transitive reduction to a graph so that redundant edges implied by longer paths are removed, leaving a minimal equivalent structure.
Provisioner Execution & Remote Access
Configuring and running provisioners, including remote connection establishment, file transfer, and script execution on hosts.
- Bastion/Jump Host Connection: Establishes an SSH connection through a bastion jump host using its own host, port, and authentication credentials.
- Infrastructure Provisioning: Drives provisioning of infrastructure and reports its start, progress, completion, and error states.
- Provisioner Configuration: Users can declare and validate provisioner configuration blocks attached to resources.
- Provisioner Execution: Run a provisioner against a resource using its connection details and step sequence.
- Provisioning: Provisioners validate their configuration and provision a resource by running steps after creation.
- Remote Command Execution: Executes commands on a remote host over a connection, using provided host and user credentials.
- Remote File Upload over SSH/SCP: Uploads individual files and directories to a remote host over SCP within an SSH session, including through a bastion host.
- Remote Script Execution: Runs a script on the remote host over the SSH session, handling its exit status and timeouts.
- SSH Connection Establishment: Connects to a remote SSH host using credentials, keys, and host key verification options.
Code Containers & Sandboxed Execution
Defining, importing, and running sandboxed code containers and observing their outputs and resource contents.
- Code Container: A user-facing container that holds code resources and the data elements they depend on or source from.
- Code Container Lifecycle Management: Surfaces a code container together with its lifecycle state so users can observe and manage the container.
- Code Container Output Retrieval: Allows consumers to retrieve outputs, resources, and instances produced by a code container execution.
- Code Execution: Executes a code artifact from a source file and makes the resulting contents and file metadata available to the caller.
- Code Import: Import code containers from external resources, creating data elements from imported content.
- Remote Code Execution: Execute code containers against remote hosts via provisioning.
- Resource Containerization: Packages code containers and their associated data elements into a managed resource unit.
- Terraform Configuration Import: Imports existing Terraform configuration into a code container.
Package & Registry Management
Fetching, caching, authenticating, and resolving packages and providers from registries, mirrors, and OCI sources.
- Module Version Lookup: Look up available versions for a module from a registry, with retry and error handling for network and registry failures.
- OCI Package Installation: Installs a package from an OCI registry by resolving its descriptor, verifying digests, and fetching the blob to a temporary file for installation.
- Package Fetching: Fetches and caches packages with progress and outcome signals observable by callers.
- Package Listing: Enumerate all packages available from a provider, including metadata for each.
- Package Location Resolution: Resolves packages to packed file paths or unpacked directories on disk.
- Provider Installation Configuration: Configures how providers are located and fetched, supporting direct/network-mirror/OCI-mirror/filesystem-mirror methods with repository mappings, includes/excludes, and trusted retry settings.
- Provider Version Discovery: Discover and report available and latest provider versions.
- Registry Access: Queries a remote module registry over HTTP to resolve module references.
Signing, Verification & Trust
Signing and verifying artifacts and packages and enforcing trust via checksums, hashes, and GPG signatures.
- Artifact Signing: Signs release artifacts using cosign and GPG keys.
- Checksum Verification: Compute and verify MD5 checksums when reading and writing remote objects to detect corruption.
- GPG Key Management: Manages GPG signing keys and key identifiers used for package verification.
- GPG Signature Verification: Determine whether a package is signed by any of a set of trusted GPG keys.
- Hash Authentication: Confirms package integrity by comparing a computed hash against an expected value.
- Package Authentication: Authenticates packages against a registry using combined checksum, hash, and signature authentication.
- Package Signature Verification: Verifies package authenticity via GPG signatures, signing keys, and signing enforcement policies.
- Trusted Source Verification: Check whether a package has been reported by a trusted mirror or registry.
What was analyzed
- Go · 1,932 files · 450,663 lines
- JSON · 468 files · 43,440 lines
- Markdown · 423 files · 40,278 lines
- HCL · 1,361 files · 14,320 lines
- Protocol Buffers · 24 files · 7,826 lines
- YAML · 23 files · 1,444 lines
- Bourne Shell · 37 files · 540 lines
- make · 1 file · 167 lines
- Python · 4 files · 115 lines
- Dockerfile · 6 files · 48 lines
- Text · 11 files · 47 lines
- Other (7 languages) · 13 files · 98 lines
Whole repository: 5,184 files. cloc 2.06 counts 558,986 lines of code in 4,303 of them (714,923 lines with comments and blanks).
Where this came from
Extracted by CoreStory V3 (build 4470 with two small engine fixes) using DeepSeek-V4.1-Flash from the public repository at commit 3967c69 on 2026-11-15. Capability descriptions are from the same run.
- Repository opentofu/opentofu
- Commit 3967c693d10833fba8a4c49ad25fe70558af9741
- Line counts cloc 2.06
- Rule citations Each rule shown was checked: its quote was compared with the repository source at the cited lines at this commit.
Code excerpts are from the upstream repository and remain under its MPL-2.0 license. CoreStory is not affiliated with or endorsed by the OpenTofu project.
Want this for your own codebase?
Talk to us about mapping the business rules in your repositories.