Dataset
Terraform configuration, plan and state datasets for AI training
A Terraform dataset is a company's Terraform working material: the .tf configurations and modules written in HCL, the plans that list each resource change with its before and after values, the state versions that map resource addresses to real infrastructure and, with HCP Terraform or Terraform Enterprise, the runs recorded per workspace. SourceX sources it to a buyer's spec from established businesses that manage infrastructure with Terraform. Each dataset is de-identified, with secrets, account IDs and network addresses scrubbed or replaced, and licensed for an agreed permitted use.
Dataset manifest
Sourced to your spec- What it is
- HCL configurations and modules, JSON plans of resource changes, state versions and run records per workspace
- Typical systems
- Terraform CLI with a state backend, HCP Terraform or Terraform Enterprise workspaces, and the Git repositories holding the .tf files
- Typical history
- Specified by the buyer; configuration history follows Git, but plans and state versions exist only where a backend or run tool kept them
- Modality
- HCL code; JSON plans and state; plain text plan and apply logs
- Delivery formats
- Agreed per order; .tf files with Git history, plan JSON and state JSON per run, run records as JSONL
- Preparation
- Sensitive attributes, variable values and keys scrubbed from state and plans; account IDs, ARNs, IP ranges and hostnames replaced with consistent tokens
- Licensing
- Rights reviewed per company; permitted use set in the license
- Availability
- Sourced to your spec from businesses that run Terraform; supply is not guaranteed
What a delivery contains
Fields vary by source system and are fixed per order. A typical delivery includes:
| Field | Type | What it holds |
|---|---|---|
| workspace | object | The Workspace the records belong to: an HCP Terraform workspace, or a backend location with a CLI workspace name. |
| run | object | The Run in HCP Terraform or Terraform Enterprise: status, source, who confirmed it and the time of each phase. |
| configuration_ref | object | The configuration version or Git commit the Run planned against. |
| configuration_files | array | Configuration (.tf) files of the root module and its local modules, with .tfvars values scrubbed. |
| module_blocks | array | Each Module block's name, source and version or Git ref. |
| providers | array | Each Provider the configuration requires, with the version selected in the dependency lock file. |
| variables | object | Input Variable values as the Plan JSON recorded them, with secret values replaced by placeholders. |
| resource_changes | array | The Plan's resource_changes: Resource address, type, actions, before and after values, after_unknown and the sensitive masks. |
| resource_drift | array | Changes the Plan found had been made outside Terraform since the last State version. |
| output_changes | object | Planned changes to each Output value, with sensitive outputs replaced. |
| apply_result | object | What the apply did, from the Run's apply log: resources added, changed and destroyed, and any error text. |
| state_versions | object | The State version lineage and the serial before and after the Run. |
| state_resources | array | Resource and Data source instances from the State file: address, schema version and attributes, after scrubbing. |
| scrubbing | object | Which attribute paths were replaced and by which rule. |
Field names from the table above; values are masked placeholders.
Example record
{
"workspace": {
"name": "payments-prod-db",
"runs_in": "hcp_terraform"
},
"run": {
"id": "run_k3f9a2",
"status": "applied",
"confirmed_by": "u_0031",
"applied_at": "2024-06-04T13:19:52Z"
},
"configuration_ref": {
"commit": "5d0c7e19a2b4"
},
"module_blocks": [
{
"name": "db",
"source": "git::[INTERNAL_GIT]/terraform-modules.git//rds",
"ref": "v2.4.1"
}
],
"providers": [
{
"source": "hashicorp/aws",
"locked_version": "5.31.0"
}
],
"variables": {
"instance_class": "db.r6g.xlarge"
},
"resource_changes": [
{
"address": "module.db.aws_db_instance.this",
"type": "aws_db_instance",
"change": {
"actions": [
"update"
],
"before": {
"instance_class": "db.r6g.large",
"password": "[SECRET:tok_91ac]"
},
"after": {
"instance_class": "db.r6g.xlarge",
"password": "[SECRET:tok_91ac]"
},
"after_sensitive": {
"password": true
}
}
},
{
"address": "module.db.aws_db_parameter_group.this",
"type": "aws_db_parameter_group",
"change": {
"actions": [
"delete",
"create"
],
"before": {
"name": "payments-pg-a"
},
"after": {
"name": "payments-pg-b"
},
"after_unknown": {
"arn": true,
"id": true
},
"replace_paths": [
[
"name"
]
]
}
}
],
"resource_drift": [
{
"address": "module.db.aws_security_group.db",
"change": {
"actions": [
"update"
],
"before": {
"tags": {}
},
"after": {
"tags": {
"hotfix": "true"
}
}
}
}
],
"apply_result": {
"added": 1,
"changed": 1,
"destroyed": 1
},
"state_versions": {
"lineage": "lin_7f3a",
"serial_before": 212,
"serial_after": 213
},
"state_resources": [
{
"address": "module.db.random_password.master",
"type": "random_password",
"attributes": {
"length": 32,
"result": "[SECRET:tok_91ac]"
},
"sensitive_attributes": [
"result"
]
}
]
}Synthetic record for illustration. Field names, structure and format are agreed per order.
What AI teams use it for
Predict what a change will do
A configuration diff paired with the plan's actions per address shows whether an edit updates in place, replaces or destroys.
Review plans before apply
Runs that were confirmed, discarded or stopped by a policy check show what reviewers accepted and refused.
Write HCL against real module structure
Root configurations that call private modules with real variable values show how one organization composes infrastructure.
Detect and resolve drift
resource_drift entries with the commit that followed show whether the team reapplied the code or changed it to match.
Evaluate infrastructure agents
Given a configuration and prior state, an agent's predicted resource changes can be scored against the recorded plan.
Use-case guides: Coding agents, Enterprise and computer-use agents, Private evaluation sets
What makes this data valuable
JSON plans, not text
Plans exist as rendered JSON with before, after and after_unknown, not only log text.
Plan, apply and state joined
Each run links its plan to the apply result and the state serial written after it.
Unbroken serials
State versions for a workspace run in sequence under one lineage.
Modules included
Private module code is delivered at the versions the root configurations call.
Lock file present
The dependency lock file fixes which provider versions produced each plan.
Reference-preserving tokens
One secret or account ID maps to one token across configuration, plan and state.
Redaction
Terraform dataset
Every plan is a labeled change, keyed by resource address
Terraform names everything it manages by a resource address, such as module.db.aws_db_instance.this or aws_subnet.private[0]: module path, resource type, name and, where count or for_each made several, an index. The same address appears in the .tf files, in each plan and in state, and it is the only join between them. A plan saved with -out is not readable as text. Rendered with terraform show -json it becomes a document whose resource_changes list gives, for each address, the actions to take (create, read, update, delete, a delete and create pair for a replacement, or no-op), the before and after objects, and replace_paths naming the attribute that forced a replacement.
The address is also where the join breaks. Renaming a resource or moving it into a module changes its address. When the author wrote a moved block, the plan entry carries a previous_address that keeps the chain. When someone ran terraform state mv by hand, the address changes between two state versions and no plan entry links them. A plan is also incomplete by design. Values the provider learns only during apply, such as IDs and ARNs, are absent from after and flagged in after_unknown, so the realized values are found only in the state version written after the apply. A run is a whole example only when the plan, the apply log and the next state serial are all present.
Where plans live depends on how the company runs Terraform. HCP Terraform and Terraform Enterprise record each run per workspace with its status, configuration version, plan and apply logs, policy check results and the state version it produced. That includes runs that were discarded and never applied, which are proposals a person refused. The plan can be fetched as JSON through the API only by a user or team with admin access to the workspace, so ask whether an export took the JSON plan or only the plan log. Teams that run the CLI in a pipeline usually keep only the text plan in a build log, with values printed as known after apply.
State and plan JSON hold secrets the configuration never shows
A state file is JSON. It has a lineage that identifies the state, a serial that rises with each write, the outputs, and a resources list in which every instance stores the attributes the provider returned. Those attributes are in plain text. Marking a variable or an output sensitive hides it in command line and interface output and nothing more. The result of a random_password, the private_key_pem of a tls_private_key, the secret of an aws_iam_access_key and a database password argument all sit in state as readable strings. The configuration that produced them usually shows only a reference.
Plan JSON has the same exposure and adds to it. Its before and after objects hold sensitive values in the clear, with before_sensitive and after_sensitive as parallel masks that say which ones they are. It embeds the prior state, and a variables block with the input values supplied for the run. A workspace variable marked sensitive in HCP Terraform is written once and not shown again, yet its value is in the state of any resource that stored it. Newer Terraform versions offer ephemeral values and write-only arguments that are left out of state and plan files, so ask whether the estate uses them.
State is also a snapshot, not a history. A local backend keeps one backup of the previous file, an object storage backend keeps earlier serials only if versioning was turned on for the bucket, and HCP Terraform and Terraform Enterprise keep a list of state versions per workspace, from which older ones can be deleted under the product's retention rules, so ask how far back they reach. To test a sample, read the paths listed in sensitive_attributes and in the sensitive masks and confirm each value is a token. Then search for private key headers and connection strings anyway, because providers do not mark everything. Check that one secret gets the same token in plan and state and that serials run without gaps.
What to check before licensing
- Have counsel for the buyer and for the data owner read HashiCorp's license and terms for Terraform, HCP Terraform or Terraform Enterprise on exported data and API use.
- Check state and plan JSON for secrets at every path marked sensitive and beyond them: generated passwords, private keys, access keys, connection strings and variable values.
- Ask how account IDs, ARNs, IP ranges, hostnames and bucket names were replaced, and whether what remains still maps the company's live security posture.
- Ask where plans come from: JSON from HCP Terraform or saved plan files, or text copied from CI logs and pull request comments.
- Ask which backend held state and whether earlier state versions exist, then check lineage and serial continuity per workspace.
- Confirm .tfvars files, the .terraform directory and backend credentials were excluded or scrubbed, and the dependency lock file kept.
- Confirm the business owns the configurations and private modules, and ask which modules came from a public registry or a vendor.
Delivery No files move before a signed license. A listing or a request grants no files by itself.
How licensing works through SourceX
- 1
Define
Send the domain, modality, volume, format, timeline and permitted use you need.
- 2
Source
SourceX identifies businesses that hold matching data and are open to licensing it.
- 3
Qualify
Fit, rights and quality are checked, and you review samples before committing.
- 4
License
Scope, permitted use, exclusivity, price and obligations are agreed in writing.
- 5
Deliver
Approved data is prepared, de-identified where required and transferred securely.
Questions Acquisition Partners ask
What does a Terraform dataset contain?
It contains the configurations, plans and state one company used to manage its infrastructure. That means .tf files and modules, plans rendered as JSON with per-resource actions and before and after values, state versions, and for HCP Terraform or Terraform Enterprise the run records per workspace. Scope it by workspace, provider and time window.
Is a text plan from CI logs enough, or do I need plan JSON?
Ask for plan JSON, because the text plan is a rendering made for people to read. The JSON lists every resource address with its actions, the before and after objects, the masks for unknown and sensitive values and the paths that forced a replacement. The text plan masks sensitive values and prints unknowns as known after apply. A plan depends on the state at that moment, so the JSON cannot be regenerated from old logs later.
Is it safe to receive Terraform state files?
Only after scrubbing, and the buyer should check a sample. State stores every resource attribute in plain text, including generated passwords, private keys and access keys. It also lists the real identifiers of the company's infrastructure. No scrubbing method is perfect, so consider whether plans alone would meet the need.
Does the business need HCP Terraform, or does CLI use count?
Either can supply a dataset, but they keep different things. HCP Terraform and Terraform Enterprise store runs, policy results and state versions per workspace. A team running the Terraform CLI from a pipeline has whatever the pipeline saved, often a text plan in a build log and the current state in a backend. Ask what was retained.
Can the buyer run plan on the delivered configurations?
Not against the original environment. A plan needs provider credentials and the live infrastructure that the state describes, and neither is part of a delivery. With replaced identifiers the configuration may still pass formatting and validation, but planning it would describe a different, empty environment.
Is SourceX affiliated with HashiCorp or IBM?
Terraform is named to identify the system the records come from. That does not imply a partnership with or endorsement by HashiCorp or IBM. The records belong to the business that runs Terraform, which licenses them under a signed agreement, and a request does not guarantee a matching dataset. Buyers should still confirm with counsel that the vendor's terms allow the intended use of exported data.
Related datasets
- Infrastructure-as-code repositories with change history
Infrastructure definitions in git, joined to the plan, apply and policy-check output of each change
- Network device configurations with change history
Versioned device configurations with per-revision diff, author, timestamp, linked change ticket and rollback markers
- Cloud cost and usage records
Line-item billing and usage exports with tags, commitments, anomalies and the optimization actions taken
- Kubernetes manifests, events and audit logs
Manifests, Helm charts and Kustomize overlays, with live object copies, Events, pod logs and API audit events
- GitHub repositories and pull request histories
Private repositories with commit history, issues, pull requests, reviews, review comments, timeline events and discussions
Evaluating this data for procurement?
Diligence packets are prepared per dataset. Rights, privacy processing and quality differ between datasets.
Request dataset diligenceTell us what your models need
Send your spec — domain, volume, format, timeline and permitted use — and SourceX will match it against partner data and come back with what can be licensed.
Updated 26 November 2026.