Back to Terraform

Recover from Partial Applies, Lost State and Emergency Changes

November 5, 2026 Wasil Zafar 28 min read

Restore trustworthy ownership and service behavior using evidence instead of an assumed rollback button

Table of Contents

  1. Freeze Writers and Preserve the Evidence
  2. A Failed Apply May Have Changed Half the Graph
  3. Recover State with Lineage and Remote Reality in Mind
  4. Re-Import When a Snapshot Cannot Be Trusted
  5. Emergency Console Fixes Must Return to the Workflow
  6. Run a Recovery Exercise with Acceptance Criteria

Freeze Writers and Preserve the Evidence

At 14:07 the apply exits 1. The log shows thirty-seven planned, a failure at number thirty, and a state file recording the twenty-nine that finished. By 14:11 a pipeline retry is queued, an engineer is editing a security group in the console, and the nightly drift job has started. Three processes now hold three different beliefs about one state key.

That is the incident; the provider error is only its first symptom.

Freeze first, diagnose second

A retry, a console edit and a scheduled drift run can all hold a different belief about the same state key. Stop every writer before you inspect anything; the order is the recovery.

Freeze the state key before you touch it. Not the account or repository — the state object and its lock. Define a writer as anything that can acquire that lock or change an object the state records: CI apply jobs, a laptop with backend credentials, scheduled applies, HCP Terraform runs, and the human in the console.

The analogy is chain of custody at a fire scene: secure the perimeter, log who enters, photograph the room before anyone moves the furniture. State recovery needs that order, because the snapshot you restore is also the evidence you destroy.

Write four lists, timestamped in UTC, before running a command that writes.

1. Affected state. Backend type, bucket or container, key or prefix, workspace, lineage, serial, Terraform version and provider versions. terraform state pull is read-only, but it prints every attribute in cleartext. Redirect it to an encrypted, access-controlled path, record a SHA-256, and keep it out of the ticket. A summary is enough for the channel: terraform state pull | jq '{serial, lineage, terraform_version, resources: (.resources | length)}'.

2. Active operations. The lock ID and holder from the error, the run ID, the job log, who started it, and which saved plans exist. A plan file from before the incident is evidence, not an executable. Terraform binds it to the state it was made from, so a stale plan fails rather than overwrites silently.

3. Remote changes. Console edits, autoscaling, provider automation, tag policies, a database failover. Audit logs lag by minutes and omit intent, so ask each on-call engineer directly and write down what they changed and why. An unrecorded console change is invisible to refresh, which updates only objects the state already knows.

4. Snapshots. Backend object versions with timestamps, a local .backup, CI artifacts, and the saved plan. Note whether each one precedes the first failed operation. A snapshot taken after the damage is a record of the damage.

EvidenceWhy it mattersWhere it belongs
State copy with lineage, serial and versionsIdentifies the exact record under repairEncrypted, access-controlled storage
Lock ID, run ID and job logNames the process that may still be writingIncident channel, not a ticket
Remote and console changesRefresh sees objects, not intentTimestamped engineer statements
Backend versions and saved plansShows what existed before the first failureRestricted evidence folder

Then stop. No plan, no refresh, no unlock until the writer list is closed. A held lock is a signal that someone may still be writing; force-unlock removes the obstacle, not the writer, which is how two applies overlap. The backend article's sequence applies: identify the holder, prove it is not writing, then clear the lock.

Separate infrastructure evidence from data evidence from the first minute. A database snapshot restores rows. It does not restore ownership, ids or outputs, and treating it as a state backup is how a recoverable outage becomes a permanent split between Terraform and the world.

Figure 1 shows the first fifteen minutes as a decision path rather than a command list.

Freeze Writers and Preserve the Evidence
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','signalColor':'#5a6e82','noteBkgColor':'#c4873b','noteTextColor':'#132440','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
    A["Apply exits 1 at 14:07"] --> B["Freeze one state key"]
    B --> C{"Every writer identified?"}
    C -->|"yes"| D["Disable CI, local and scheduled runs"]
    C -->|"unknown holder"| E["Read lock ID and run history"]
    C -->|"no"| M["A second writer can still apply"]
    E --> F["Do not force-unlock on suspicion"]
    D --> G["Pull a state copy to restricted storage"]
    G --> H["Record lineage, serial and versions"]
    H --> I["Inventory remote objects and console edits"]
    I --> J{"Snapshot precedes the bad write?"}
    J -->|"yes"| K["Backend version recovery"]
    J -->|"no or unknown"| L["Isolated re-import"]
    M --> N["Stop that writer before recovery"]
    F -.-> M
    N -.-> B
    classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
    classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
    classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
    classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
    classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
    class B,C,J primary;
    class A,D,E,G,H,I,L secondary;
    class K ok;
    class F warn;
    class M,N danger;

Figure 2 places the four evidence sources on the right side of a boundary that only read operations may cross.

One state key, four evidence sources, one freeze line Control-plane writers — CI, local CLI, scheduled jobs and a console operator — are stopped at a freeze gate before they can reach the state backend. The backend holds the lock, the current serial and lineage, and prior object versions. It exchanges reads and writes with the cloud API, where the live objects exist. A read-only evidence store receives a state copy, the apply log, plan JSON and the timeline. Writes may not cross until every writer is accounted for. Freeze one state key, not the account Writers — control plane CI apply Local CLI Scheduled run Console operator Anything that can take the lock or change a managed object Freeze: disable runs, name the lock holder, stop edits State backend — the record lock object serial + lineage version history refresh, then apply Cloud API — the reality bucket route policy database Evidence store — read only state copy + SHA-256 lineage, serial, versions apply log failed address, timestamps plan JSON resource_changes, actions timeline who, what, when, why Reads may cross the boundary. Writes wait until every writer is accounted for.

A Failed Apply May Have Changed Half the Graph

A Terraform apply is not one transaction. Each resource operation is its own provider call, and state is written after each completion. When an operation fails, Terraform records what succeeded, releases the lock, and exits; it does not roll back the completed work (apply errors). The graph walk makes the result worse than a simple prefix: independent branches run in parallel, so several may be half-finished when the first error stops new work.

A composite incident: a root manages a payment service's network. A security group replacement deletes the old group, then fails to create the new one because the name is still held during the provider's eventual consistency window. The ingress rule that depended on the group is never attempted, and the service loses connectivity. An operator creates the group and rule in the console; the pipeline retry, whose plan cannot see objects the state never recorded, tries to create them again and the provider rejects the duplicate name. The provider error took two seconds. The ownership conflict took forty minutes.

Four shapes of half-graph need different next moves:

  • Absent create. The provider rejected the call; no object exists. State and cloud agree.
  • Orphaned create. The provider created the object and then the call timed out. The object exists; the state has no record of it.
  • Replacement gap. The destroy succeeded and the create failed. The old object is gone, the new one does not exist, and no address owns the capability.
  • Partial update. Some attributes changed before the error. State holds the values from the last successful write, which are neither the old nor the intended new shape.

Tainted records are the fifth case: a create or provisioner failed after the object existed, so the next plan proposes replacement. That is a proposal, not an automatic repair.

Before any recovery plan, reconcile three views for every address: configuration, state and the provider's live inventory. terraform state list -id, terraform state show ADDRESS, the apply log, and a read-only cloud query by owner tag. Classify each row as consistent, stale (record behind remote), conflicting (values disagree), or unrecorded (present but absent from state). The classification, not the error message, chooses the recovery.

Do not reach for -target to finish the failed branch. Targeting plans a subset against a partial graph and hides the dependents that were never attempted; it is an exceptional tool for this recovery, but only after the inventory exists. Do not delete state to "start clean"; that converts every surviving object into an orphan. And do not import the first resource you recognize before you know which state should own it.

Figure 3 lays the three views beside one another.

One object, three claims Four addresses are compared across configuration, state and the cloud. The bucket agrees everywhere. The policy configuration is ahead of the state record. The route has a different target in state and cloud. A second bucket exists only in the console and has no state record. The plan is a proposal built from the first two columns, so the cloud column must be checked separately. One object, three claims The plan is a fourth claim: a proposal built from the first two. Address Configuration (desired) State (last record) Cloud (live) aws_s3_bucket.logs tf-app-logs tf-app-logs, serial 41 tf-app-logs aws_s3_bucket_policy policy v3 policy v2 policy v3 aws_route.api 10.0.2.0/24 to nat 10.0.2.0/24 to nat-a 10.0.2.0/24 to nat-b aws_s3_bucket.audit not declared no record created in console Verdicts agree no action stale record refresh, then adjudicate conflict fix config or state unrecorded import or delete Refresh updates records for known addresses only. It cannot discover an unrecorded object.

Figure 4 follows the failure branches from the operation that failed to the evidence each one requires.

A Failed Apply May Have Changed Half the Graph
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','signalColor':'#5a6e82','noteBkgColor':'#c4873b','noteTextColor':'#132440','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
    A["Apply stops mid-graph"] --> B{"Which operation failed?"}
    B -->|"create rejected"| C["Object absent, state agrees"]
    B -->|"create timed out after success"| D["Object exists, no state record"]
    B -->|"destroy then create"| E["Replacement gap: old gone, new absent"]
    B -->|"update"| F["Attributes half-applied"]
    C --> G["Resume the forward fix"]
    D --> H["Import or delete the orphan"]
    E --> I["Rebuild the capability, then plan"]
    F --> J["Refresh and adjudicate each value"]
    H --> G
    I --> G
    J --> G
    K["Tainted record: next plan proposes replacement"] -.-> B
    G --> L["Normal plan reviewed, then apply"]
    classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
    classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
    classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
    classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
    classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
    class A,B primary;
    class C,H,I,J secondary;
    class D,F,K warn;
    class E danger;
    class G,L ok;

Recover State with Lineage and Remote Reality in Mind

Two questions decide the route. Is there a snapshot whose lineage matches this state and whose timestamp precedes the first failed write? And does that snapshot still describe objects that exist? A trustworthy snapshot answers both; anything else is a re-import candidate.

Prefer the backend's own version recovery. S3 versioning, GCS object generations, Azure blob versions and HCP Terraform state versions all keep prior objects and expose them through the storage interface. Restore by copying the chosen version aside, inspecting it, then promoting it over the live key. The copy creates a new version, so the damaged current object remains recoverable. Lineage is preserved, the serial returns to an earlier value, and no CLI safety check has to be forced.

That last point is the reason to prefer it. terraform state push refuses a state with a different lineage and refuses to overwrite a destination whose serial is higher (state push). Restoring an older snapshot through the CLI therefore fails the serial check by design, and the only way through is -force. The backend route has the same effect without teaching the operator to disable the guard.

If you must use pull and push, make the safeguards explicit and reviewable:

  • Two named people: an operator and a reviewer, both recorded in the incident channel.
  • Proof of freeze: every writer disabled, no run active, lock clear.
  • A checksum, lineage, serial and timestamp for the artifact, plus the incident moment it precedes.
  • A copy of the current state before the push, stored where the reviewer can reach it.
  • No -force. A lineage mismatch means you have the wrong state, not a stubborn tool.
  • After the push: state list -id, then plan -refresh-only, then a normal plan. Record the new serial and lineage.

The serial matters more than it looks. A restore moves the record backwards; any plan file or cached state from the higher serial is now stale. Terraform will reject those plans, which is a safety feature, but only if you discard them rather than debug the rejection.

Then reconcile with reality. A restored snapshot knows only what was true when it was written. Console changes made after it are invisible, objects created after it are unrecorded, and objects deleted after it still appear owned. Run terraform plan -refresh-only to see the record-to-remote delta, adjudicate each row, and only then run a normal plan. Restoring state is not the end of recovery; it is the moment the record becomes a hypothesis again.

Keep data recovery on its own clock. Restoring a database to 13:55 does not change Terraform's record, and Terraform may see the restored instance as changed or replaced. Decide the order: restore data, then reconcile attributes, or Terraform will propose replacing what you just recovered.

Re-Import When a Snapshot Cannot Be Trusted

Re-import is the honest path when no snapshot matches the lineage, the only copy is a hand-edited file, the state came from another environment, or the record and the cloud disagree in ways no single version explains. Import does not recover history. It rebuilds ownership from the objects that actually exist.

Build the inventory from the provider, not from memory. Query by account, region and the tags or naming convention that mark Terraform ownership. For each object, record its provider id, its current configuration, and the address that should own it.

Do the rebuild in an isolated recovery environment: the configuration from the incident commit, a separate state key under a recovery/ prefix, and credentials that can read the account and write only the recovery state. Do not import into the production state first. The recovery environment is where wrong mappings are cheap.

An import block names the destination address and the provider identity; the resource block must declare the same address. For an S3 bucket the identity is the bucket name:

import {
  to = aws_s3_bucket.checkpoint
  id = "tf-recovery-lab-2026-11-05"
}

resource "aws_s3_bucket" "checkpoint" {
  bucket        = "tf-recovery-lab-2026-11-05"
  force_destroy = true
}

terraform plan -generate-config-out=generated.tf can draft configuration for imported objects, but it is experimental and it writes what the provider returns, including defaults you did not choose. Review every generated attribute; an import that produces a permanent diff is a mapping that is not finished.

The acceptance test is a no-change plan. terraform plan -detailed-exitcode returns 0 only when the configuration and the refreshed record agree. Iterate on configuration until it does — not on state, and not with ignore_changes unless the provider genuinely normalizes the value and you document why. A count check is the second test: addresses in the recovery state must equal owned objects in the inventory.

Before cutover, check for competing owners: another root's state, a CloudFormation stack, a platform team's automation. Two states that import one object fight on every apply, and the fight looks like drift.

Cutover has two legitimate forms. Promote the recovery state to the production key and accept a new lineage, or keep the production state and add the import blocks there under the same freeze, preserving lineage. The first is cleaner after a total loss; the second keeps history continuous. Record which one you chose and why. Import never restores outputs, historical serials or deleted objects, so expect the first post-recovery apply to recompute outputs.

Emergency Console Fixes Must Return to the Workflow

The console is not a second workflow

An emergency edit is allowed to stop the bleeding. It is not allowed to become the new source of truth: import or revert it, record who did it, and close the drift loop with a reviewed plan.

At 02:14 the console is the fastest way to restore service. A security group rule, a route, a parameter, a pool size — one edit and the graph stops bleeding. That edit is legitimate. Leaving it unmanaged is what turns a fixed incident into next month's failed apply.

There are only two endings. Adopt the change: make the configuration describe what the console now does, persist the refreshed record, and prove a no-change plan. Revert it: put the remote object back the way the configuration expects, persist the refreshed record, and prove the same plan. "Forget" is not an ending; it is a deferred change that surfaces when someone edits an unrelated attribute.

Adoption starts by exporting the exact remote values, not by retyping what you remember. The API returns the full object; the console shows a summary. Translate those values into HCL, then run a normal plan. If the configuration matches, the plan is empty. If it proposes a change, the configuration is still describing the old shape. Apply that plan, or run terraform apply -refresh-only, to persist the refreshed state.

Revert runs in the opposite direction. Change the remote object back, then run plan -refresh-only and apply it so the record matches. A normal plan should now be empty. If the console change was the fix, reverting it re-breaks the service — so the decision belongs to the incident owner, not to whoever is at the keyboard.

Use the right mechanism for the shape of the change:

  • A console-created object needs import to be adopted; until then it is invisible and the next apply may create a duplicate.
  • A console-deleted object that should exist is recreated by a normal apply.
  • A console-deleted object that should stay gone is removed from configuration, ideally with a removed block so the intent is versioned.
  • An attribute changed in place is adopted by editing the argument, or reverted at the provider.
  • state rm hands an object out of Terraform's ownership; it neither reverts nor deletes it.

terraform apply -refresh-only is a record update, not a configuration update. It will happily record a value that makes your configuration wrong, which is why the reviewed diff comes first. It also cannot discover an object that has no address, so a console-created resource still needs an import.

Close the loop. Drift detection should catch anything you missed; the incident ticket should carry the object id, old and new values, the actor, the decision and an expiry for any temporary exception. If the console was used because the pipeline was too slow or restrictive, fix that cause, or the next operator will inherit the same drift.

Figure 5 shows the two endings converging on the same evidence.

An emergency edit ends in a decision, not in drift An uncommitted console edit at 02:14 branches on whether the fix was correct. Adopting it means exporting the exact values, codifying them in HCL and refreshing. Reverting means restoring the old shape at the provider and refreshing. Both paths end at a normal plan with no changes and a closed drift record. Leaving the edit undecided lets the next apply propose an unexpected change. An emergency edit ends in a decision, not in drift 02:14 console edit security group rule route association pool size no commit, no plan Was the fix correct? Adopt export exact values codify in HCL refresh-only plan Normal plan exit 0 no changes Revert restore the old shape in console or API refresh-only plan Normal plan exit 0 no changes keep undo Close the drift record object id · old and new values · actor · approver · expiry Update the runbook, not just the ticket. No decision The next apply refreshes the object, proposes an unexpected change, and turns one incident into two.

Run a Recovery Exercise with Acceptance Criteria

Git revert is not recovery

Reverting a commit changes desired state, not the half-written world. It can destroy what the failed apply created, recreate what it removed, and fail on anything the provider will not undo. Treat it as a new change with its own reviewed plan.

Five different actions get called "rollback", and confusing them during an incident costs hours.

  • Git rollback restores configuration. It changes no infrastructure; applying the reverted commit is a new forward apply against current state.
  • State restore rebuilds the record. It changes no infrastructure and cannot resurrect a deleted object.
  • Resource replacement (-replace=ADDRESS) plans a replacement at the same address. It is not a restore, and for a stateful resource it discards data.
  • Backup restore returns data to an earlier point. It does not update Terraform's record of the object.
  • Forward fix changes configuration and state toward a new correct shape. It is the only one that can repair a partial graph without pretending the past is available.

Write the runbook so that a tired operator can tell them apart at 03:00. Then rehearse it in a disposable account, because a runbook that has never been executed is a hypothesis with good formatting.

The workbook's acceptance criteria translate into four artifacts:

  • Timeline. UTC timestamps from first anomaly to first no-change plan, with every command, actor and decision. If a step is missing from the timeline, it did not happen in a reviewable way.
  • Writer-control record. Every writer, how it was disabled, who confirmed it, when the lock was proven clear, and whether force-unlock was used and why.
  • Recovery decision. Snapshot version or import inventory, the evidence that made it trustworthy, the path chosen, the approver, and the alternatives rejected.
  • Final reconciliation. A normal plan with -detailed-exitcode returning 0, the state serial and lineage, an inventory count that matches, and a closed drift record.

Add the two criteria that incidents usually omit. Data recovery needs its own restore point and verification query, with actual RPO and RTO written beside the targets. And the exercise needs a measured duration: if the runbook promises thirty minutes and the rehearsal takes ninety, the promise is the defect.

Run it against a synthetic failure. Break a dependency after the first resource, or delete the state after a successful apply, then follow the runbook exactly as written. Time every phase: freeze, evidence, decision, state recovery, reconciliation. The surprises are the deliverable — the step where two people disagreed about who owned the lock, the console change nobody recorded, the import that produced a diff because a provider default was missing.

Repeat at a cadence you can sustain, and update the runbook after every rehearsal and incident. The goal is not a perfect recovery. It is a recovery that a second person can audit and a third person can repeat.

The lab below makes it concrete in a disposable account.

Lab

Recover a disposable environment

Execution status: design-only. The sequence was not run for this article. It targets a disposable AWS account with Terraform CLI 1.17.1 and hashicorp/aws 6.72.0, checked on 5 November 2026.

Prerequisites. A disposable AWS account, an IAM principal that can create and delete one S3 bucket in it, Terraform 1.17.1, AWS CLI v2, jq, and a scratch Git repository. Never point these commands at an account holding production state. To test backend version recovery, add an S3 backend with versioning and a dedicated key.

Minimal setup. Create labs/p32/main.tf with a bucket and a gate that fails after it exists:

terraform {
  required_version = "1.17.1"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "6.72.0"
    }
  }
}

resource "aws_s3_bucket" "checkpoint" {
  bucket        = "tf-recovery-lab-2026-11-05"
  force_destroy = true
}

resource "terraform_data" "gate" {
  depends_on = [aws_s3_bucket.checkpoint]

  provisioner "local-exec" {
    command = "exit 1"
  }
}
  1. Apply and capture the failure. Run terraform init and terraform apply. The bucket is created, the gate's provisioner exits 1, and the apply exits 1 with a partial graph. Save the console log and terraform show -json to incident/after.json.
  2. Freeze. Do not retry. Confirm the lock is released, then list every writer that could touch this directory: your shell, any CI job, any scheduled run. Write the writer-control record with the time each was ruled out.
  3. Record, then simulate loss. Run terraform state pull | jq '{serial, lineage, resources: (.resources | length)}' and write the summary into the timeline. Hash terraform.tfstate, then delete it and terraform.tfstate.backup. This drill assumes no trusted snapshot survives; the provider inventory and the logs are the evidence.
  4. Build the recovery root. In labs/p32/recovery/, declare only the bucket plus an import block:
import {
  to = aws_s3_bucket.checkpoint
  id = "tf-recovery-lab-2026-11-05"
}

resource "aws_s3_bucket" "checkpoint" {
  bucket        = "tf-recovery-lab-2026-11-05"
  force_destroy = true
}
  1. Prove the mapping. Run terraform init and terraform plan. Expect one import, zero to add, change or destroy. A proposed change means the configuration does not yet describe the live bucket; fix the configuration, not the state.
  2. Apply and verify. Run terraform apply, then check that terraform plan -detailed-exitcode exits 0. Run terraform state list -id and compare the single address and bucket id with the inventory.
  3. Check for duplicates. aws s3api list-buckets --query "Buckets[?starts_with(Name, 'tf-recovery-lab-')].Name" --output text must return exactly one name. A second bucket means the wrong identity.
  4. Write the runbook. Turn the timeline into a numbered procedure with the four acceptance artifacts. Add the backend-version variant: restore the noncurrent state object, inspect its lineage and serial, then run plan -refresh-only before the normal plan.
  5. Rehearse the decision. With a second person, ask which path the timeline supports. A split answer means a missing decision rule.

Expected observation. One imported address, a no-change plan with exit code 0, one live bucket, and a written record that another engineer can follow. The gate stays gone because the recovery configuration dropped the synthetic resource; record that as a forward fix.

Failure checks. A plan that proposes a second bucket means the import identity is wrong. A permanent diff usually means a provider-defaulted attribute is missing from the configuration. A lineage warning means you are mixing states; stop and re-read the source artifact. A bucket-name collision at step 1 means the fixture needs a different suffix. Any use of state push -force fails the exercise.

Cost dimensions. One S3 bucket with a few bytes of data; storage and request charges are cents at most. The real cost is the account and teardown. Delete the bucket in the same session.

Cleanup. Run terraform destroy in the recovery root and confirm the bucket is gone. Delete incident/ after the retention decision, revoke any temporary credentials, and keep the runbook, not the state copies.

Next in the Series

In Terraform Stacks: Components, Deployments and Orchestration, we'll explore Distinguish the Terraform Stacks product from informal stacks of root modules and evaluate its execution model.