Establish a Disposable Brownfield Inventory
A capstone is a migration a stranger can audit. You will take six objects that nobody wrote in HCL, put them under two roots without replacing any of them, rename every address, absorb one console edit, and then lose the state file and rebuild ownership. The applies are routine. The deliverable is the argument that nothing moved except the record.
The estate is small on purpose. A team built an intake service by hand over a few months: an artifacts bucket with its versioning and encryption, a work queue and a dead-letter queue, and an orders table. It works, it is documented in a wiki page nobody updated, and no one can say which objects Terraform should own. That uncertainty is the brownfield problem, and it is an evidence problem before it is a coding problem.
The fixture is six managed objects and one decoy. Build it with the console or the cloud CLI, never with Terraform, and let it run for an hour so the application has created whatever it creates.
| Object | Provider type | Placed by | Why it belongs in the ledger |
|---|---|---|---|
| Artifacts bucket | aws_s3_bucket | Console | The bucket name is the identity, not the address |
| Bucket versioning | aws_s3_bucket_versioning | Console | A child object with its own state address |
| Bucket encryption | aws_s3_bucket_server_side_encryption_configuration | Console | A setting that a fresh apply would re-decide |
| Work queue | aws_sqs_queue | CLI script | The drift target, and a URL-shaped import id |
| Dead-letter queue | aws_sqs_queue | CLI script | Same type as its sibling, different configuration |
| Orders table | aws_dynamodb_table | CLI script | Migrates to the second root later |
| Application log group | aws_cloudwatch_log_group | Created by the running app | Present, unowned, deliberately excluded |
One tag prefix draws the project boundary. Every fixture object carries a project tag and an owner tag, and the ledger admits only objects that carry both. A tag is evidence of intent, not proof of title: a teammate's script can copy a tag in seconds, so each row still needs a state search behind it.
Four columns make a row defensible, and each one has a rejection test. A row that fails its test is not a row with a weak field; it is a row that cannot be imported yet.
| Column | Filled from | Rejected when |
|---|---|---|
| Provider id | The provider's own read, pasted rather than retyped | It was reconstructed from a naming convention |
| Live shape | A read of the object: arguments, tags, children | It came from memory or an old ticket |
| Current owner | A search of every state that could hold the address | It says "probably the platform team" |
| Target root | One of the two roots this capstone defines | It says "decide later" |
The decoy teaches the harder lesson. The log group exists in the account and appears in no ledger row, because the application creates it on first invocation. It is excluded with a written reason and an expiry date. Build the inventory before the first request and it will be missing entirely, which is why an empty result is never evidence of an unmanaged estate.
"Unmanaged" and "unowned" are different findings. An object that no state records is unmanaged. An object a person maintains by hand is unowned by Terraform and owned by that person, and the two need different next steps. The second kind needs an agreement before a row is written, because an import takes away someone's ability to fix an outage at 02:00. The ledger records the agreement, not only the intention.
Figure 1 is the decision every candidate row has to survive.
%%{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','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#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','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
E["Seven objects in a disposable account"] --> S["Scope: one region, one tag prefix
one fixture, no production data"]
S --> T{"Carries both project tags?"}
T -->|"no"| X["Out of scope
reason plus expiry date"]
T -->|"yes"| O{"Does any state already claim it?"}
O -->|"yes"| H["Hand-off agreement
before any import"]
O -->|"no"| R{"Does the provider support import
for this type?"}
H --> R
R -->|"no"| Q["Excluded, with a named owner outside Terraform"]
R -->|"yes"| L["Ledger row D1
id, live shape, owner, target root"]
L --> F["Freeze writers, then snapshot the ledger"]
F --> V["D1 ready for review"]
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 T,O,R primary;
class E,S,L,F secondary;
class V ok;
class X,H warn;
class Q danger;
Inventory is a moment, not a document. Two things move while you are reading: the application creates objects, and a scheduled task rotates something. State the window, stop the writers you can, and stamp the ledger with the time it describes. A ledger with no timestamp is a claim about an estate that no longer exists.
Figure 2 places the ledger between the estate and its claimants. Reads cross the boundary in one direction until D1 is signed.
The sandbox has prerequisites with stop rules. A prerequisite that fails quietly at apply time becomes a mystery during acceptance, so write the check and the decision to stop into the same row.
| Prerequisite | How to verify | If it fails |
|---|---|---|
| A disposable account and one region | The provider identity resolves to an account you are willing to delete | Stop; do not create the fixture |
| Terraform 1.17.1 and AWS provider 6.72.0 | The version constraint and the lock file agree | Pin both before importing anything |
| AWS CLI v2 and a JSON filter | A read-only call returns the tagged objects | Stop; you cannot build D1 |
| A reviewer who did not build the fixture | A name recorded in D1 | The capstone has no gate |
| A cost ceiling for the session | A number and three stop rules in D1 | Treat the fixture as unlimited spend |
D1 is finished when someone else can read it. Seven rows, one exclusion with a reason and an expiry, a timestamp, a cost ceiling, and a named reviewer. Nothing has been imported at that point, which is exactly the claim the reviewer is checking.
Review Imports and Reach a No-Change Baseline
Adoption has one acceptance test. After an import, a fresh plan must propose nothing. That is the only evidence that your configuration describes the object as it exists, rather than the object you imagined while writing HCL.
Adopt one object per plan, in dependency order. Bucket first, then its versioning and encryption, then the two queues, then the table. Each run produces one plan summary you can attach to one ledger row, and one place to stop if the summary is not exactly an import.
The identity is the provider's, and it varies by type. Copy it from a read of the object; never reconstruct it from a name pattern that happens to look right.
| Object | Import identity | Wrong-identity symptom |
|---|---|---|
| Artifacts bucket | Bucket name | A create plan, or a "not found" on a name you did not retype |
| Bucket versioning | Bucket name | A create for a child that already exists remotely |
| Bucket encryption | Bucket name | A create that would re-decide the algorithm |
| Work queue and dead-letter queue | The queue URL | A plan that wants to create a queue with the same name |
| Orders table | Table name | A create whose name collides at apply time |
Import blocks are the default and the CLI is the exception. A block puts the intent in a reviewed file and renders the import as a plan action; the CLI writes state immediately with no preview. In this capstone the exception is one object, inside a frozen window, when a block cannot be applied for an unrelated reason. Record which form you used for each row.
The generated draft is a transcript, not a design. Generation transcribes what the provider returns, including nulls, computed values and defaults nobody chose. Keep the generated file out of Git, merge only the blocks you have read, then delete it, because a leftover duplicate declaration stops the next plan.
Importing the parent does not import the children. The bucket address records the bucket; versioning, encryption and lifecycle are separate addresses with their own identities. Omit one and the next plan proposes a create for a setting that already exists, which either fails at the provider or silently adopts a value nobody reviewed. Either way the baseline stops being a baseline.
Figure 3 is the mechanics, including the branches where an import succeeds and is still wrong.
%%{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','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#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','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
A["One signed ledger row"] --> B{"Importer exists for this type?"}
B -->|"no"| C["Cannot adopt without recreation"]
B -->|"yes"| D{"Does anything already claim it?"}
D -->|"this state"| E["Already imported: drop the block"]
D -->|"another state"| E2["Two owners: agree a release first"]
D -->|"neither"| F["Import block plus matching resource block"]
F --> G{"What does the plan summary say?"}
G -->|"import only"| H["Apply: record written, remote untouched"]
G -->|"import and update"| I["Configuration still describes a guess"]
G -->|"import and replace"| J["An immutable argument differs"]
I --> G
J --> K["Fix the identity, not the attribute"]
H --> L{"plan -detailed-exitcode"}
L -->|"0"| M["Row signed off in D2"]
L -->|"2"| I
E --> A
E2 --> A
K --> A
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,D,G,L primary;
class A,F,H secondary;
class M ok;
class I,J,C warn;
class E,E2,K danger;
Six import plans, then one combined proof. The baseline in D2 is a table, not a paragraph: the row, the plan summary, the exit code and the artifact path. A summary of one import and nothing else is the pass condition; anything else is a conversation with the identity.
| Row | Expected plan summary | Exit code | Artifact to keep |
|---|---|---|---|
| Bucket | One import, nothing else | 0 on the second plan | Saved import plan and state show |
| Versioning | One import, nothing else | 0 | Saved plan, second exit code |
| Encryption | One import, nothing else | 0 | Saved plan, second exit code |
| Work queue | One import, nothing else | 0 | Saved plan plus the queue URL |
| Dead-letter queue | One import, nothing else | 0 | Saved plan plus the queue URL |
| Table | One import, nothing else | 0 | Saved plan, second exit code |
| Whole root | No changes at all | 0 | One combined no-change proof |
Bulk discovery answers a different question than adoption. Run the query once to confirm that nothing else in the region carries the tag prefix, and set a limit you can explain. A result count equal to the limit is a truncation warning, not a complete estate, and the generated file is a candidate list rather than a work queue.
An import plan that also proposes an update is a verdict on your configuration. The plan is telling you the configuration differs from the object, and the repair is editorial. When the difference lands on an immutable argument the summary becomes a replacement, and a replacement inside an adoption commit is a rebuild with extra steps.
Refresh runs during every plan, and a plan alone does not persist it. The comparison uses a refreshed view of the remote object; the refreshed record is written only when a plan is applied. That distinction matters twice in this capstone: once here, where a quiet plan proves the comparison rather than the state file, and again when a console edit has to be recorded.
One permanent diff means the baseline is unfinished. The usual causes are short: an argument the provider does not store, a computed attribute you tried to manage, or a default the provider fills that the hand-built object never had. Fix the configuration until the diff disappears; do not apply a change to make reality match a draft.
D2 is an exit code, not a screenshot. One combined plan with no changes, captured after the last row, is what the reviewer reads. The six per-row proofs explain how you got there, and the final one proves the root is quiet when nothing is being imported.
Refactor Addresses and Split Ownership Deliberately
A rename is a plan you must not apply. Change an address in configuration without a migration instruction and Terraform sees a destroy and an unrelated create: the object is deleted and rebuilt under a new identity, and every reference to the old identity points at something gone. Nothing about that plan looks unusual.
Refactoring is two different jobs with two different proofs. A moved block rewrites an address inside one state and shows up as an annotation, not an action. A root split moves an object between two states and has to go through zero owners, because two owners is the state where both plans look clean.
The platform root gets the first refactor: flat addresses become a module and a keyed collection. Both are ordinary edits, and both are cheap to get wrong.
| Move (from → to) | Plan must show |
|---|---|
aws_s3_bucket.artifacts→ module.storage.aws_s3_bucket.artifacts | A move annotation, no create |
aws_s3_bucket_versioning.artifacts→ module.storage.aws_s3_bucket_versioning.artifacts | A move annotation, no create |
aws_sqs_queue.jobs→ aws_sqs_queue.this["jobs"] | A move annotation, no create |
aws_sqs_queue.dead_letter→ aws_sqs_queue.this["dlq"] | A move annotation, no create |
The encryption configuration follows the same pattern: aws_s3_bucket_server_side_encryption_configuration.artifacts becomes module.storage.aws_s3_bucket_server_side_encryption_configuration.artifacts, with the moved block placed in the calling module rather than in storage itself.
Moving into a module puts the block in the parent. A moved block can only name an address it can see, and a child module cannot name its own caller. Put the block where the new address is rooted, which for a module address is the calling module.
The queue pair becomes one keyed resource, and that is a separate kind of move. Two resources collapse into one for_each map with two keys, so each key needs its own block from its old address. The object did not change, the provider id did not change, and a plan that reports two moves and zero changes is the proof.
The module needs the identity as an input, not a literal. If the storage module hardcodes the bucket name that already exists, the first plan after the move proposes a rename, and a renamed S3 bucket is a replacement rather than an update. Pass the existing name in as a variable so the module's create path and the imported object describe the same object.
terraform state mv is the exception, and it is a state write with no plan. It rewrites one binding inside one state file, leaves no record in the repository, and cannot be reviewed before it happens. Use it when a module was published without a move block or a provider address changed, and record the command, the serial before and after, and the reason the declarative route was unavailable.
Figure 4 is the ownership timeline, including the shortcut that looks faster and costs data.
Splitting a root is a six-step transfer with proof at every step. The window is announced, the identity is recorded, and the object is unowned for a few minutes rather than doubly owned for any length of time.
| Step | Action | Evidence it worked |
|---|---|---|
| 1 | Freeze both roots and record serial and lineage | No run in flight, both serials written down |
| 2 | Record the provider id from the source state | An id that matches the D1 row |
| 3 | Declare the table in the data root, apply nothing | A plan that wants to create it |
| 4 | Release with a removed block that does not destroy | Address gone from the source, object still live |
| 5 | Adopt with an import block using the recorded id | One import, nothing else |
| 6 | Plan both roots | Zero changes on each, ids match D1 |
The negative control is what makes the refactor evidence. Copy the directory, delete the moved blocks in the copy, and plan there. A create plus a destroy is the correct answer in the copy: it demonstrates the outcome the blocks prevented, instead of asserting that they worked.
What disqualifies a refactor is any provider write. A replacement summary, a tainted record, a single attribute update riding along with the move, or an apply that was run twice because the first summary looked odd. The refactor's whole claim is that infrastructure did not move, so one provider call disproves it.
Introduce and Reconcile One Controlled Drift
Drift is a decision point, not an alarm. Something changed the world outside Terraform, and the only question that matters is whether that change was correct. Detection is the easy half; the second half is an ending, recorded by someone with the authority to choose it.
The event is one console edit with a good reason. During a backlog, an on-call engineer raises the work queue's message retention so retries survive a downstream outage. It fixes the incident. It is also invisible to Terraform: the state still records the old value, and the next plan will offer to put it back.
Record before you reconcile. Capture the object, the attribute, the old and new values, the actor and the reason, and hash the evidence you keep. A drift record written after the fix is a story; one written before it is evidence.
Detection is cheap and adjudication is the work. A drift report with forty differences has produced forty decisions, not forty tasks. Group them by object and by owner, decide each group once, and write the decision against the object, because the next report will show the same rows until somebody ends them.
A second owner looks exactly like drift. When another root or a console-driven pipeline writes to a managed object, the difference returns after every reconciliation and each fix looks like a failure of the previous one. Check for competing writers before you reconcile the same attribute twice.
| Field | Content | Why the reviewer needs it |
|---|---|---|
| Object | The ledger row and provider id | Ties the drift to an owned object, not a name |
| Attribute | Retention value, old and new | The exact change, not "queue settings" |
| Actor and reason | Named engineer, incident reference | Distinguishes a fix from an accident |
| Evidence | Remote read, plan summary, timestamps | Proves the value came from the provider |
| Decision | Adopt or revert, with an approver | The ending, chosen before the plan is read |
| Expiry | When the exception stops being valid | Prevents a temporary fix becoming permanent |
Both endings produce an empty plan, which is why the decision must come first. Adopt and the configuration is edited to match the remote value; revert and the remote value is changed back to match the configuration. Either way the next plan is quiet, so the plan cannot tell you which one you chose. Only the record can.
| Ending | Configuration | Remote object | State | What the quiet plan proves |
|---|---|---|---|---|
| Adopt | Edited to the new retention | Unchanged | Refreshed, then persisted | The record caught up with a deliberate fix |
| Revert | Unchanged | Written back to the old value | Refreshed, then persisted | The world was returned to the reviewed shape |
Adoption starts with a provider read, not a retyped number. Put the remote value into the argument, plan, and accept an empty diff as confirmation; then persist the refreshed record so the serial reflects the new truth. An empty plan alone leaves state behind the world, and the next unrelated change brings the drift back.
ignore_changes is not an ending. It suppresses the diff and keeps the ambiguity. Once it is in the configuration, nobody can tell whether the remote value is a deliberate exception or a forgotten edit, and the record stops being a description of the estate.
Name the cause if the console was faster than the pipeline. If the on-call engineer edited the queue because the reviewed path takes forty minutes, that latency is the finding, and it belongs in the drift record next to the retention value. Otherwise the next incident produces the same edit and a second record.
Rehearse a Partial-Apply or Lost-State Incident
The incident begins as an ordinary change. The intake service needs a lifecycle rule on the artifacts bucket, a second bucket for a new consumer, and versioning on that second bucket. Three additions, one plan, and a name that a teammate's script has already taken.
The plan is not the failure; the name is. The second bucket's create is rejected by the provider because the name already exists in the account. The lifecycle configuration has already been applied, the new bucket does not exist, and the versioning resource that depends on it was never attempted. Terraform records what succeeded and exits.
Figure 5 is the planned graph beside the graph that actually happened.
Freeze is a list, not a feeling. Name every process that can write, and close each one before you read anything. A held lock is a signal that a writer may still exist, not an obstacle to remove.
| Writer | How it is closed | Proof recorded in D5 |
|---|---|---|
| A second terminal on the same directory | Closed, scrollback saved | Terminal history timestamp |
| A CI job pointed at the same state | Paused at the pipeline level | Pipeline run list showing no active run |
| A scheduled drift job | Disabled, not just skipped | Schedule entry and its last run |
| The console | A written freeze and an acknowledgement | Names and times in D5 |
| The demo application | Stopped | Last invocation time against the decoy's creation time |
Evidence that survives a lost state is mostly outside Terraform. The apply log names the failed address and the completed one. The saved plan describes the intent that was reviewed. The provider reads describe what exists now, including the lifecycle rules that landed. The ledger describes what should exist. None of them is a state file, and together they are enough to rebuild one.
The saved plan is a witness and a liability. Terraform binds a plan file to the state it was built from, so once the record is rebuilt the old plan is refused rather than applied silently. That refusal is a safety feature; discard the plan and record that you did, instead of debugging it.
Classify each address before choosing a route. Four verdicts are enough: consistent, stale, conflicting and unrecorded. The lifecycle rules that landed are consistent with the configuration and need nothing. The second bucket is absent and stays absent. The versioning resource was never attempted, so it is missing rather than unrecorded, and it needs a decision instead of an import.
Targeting hides the dependents nobody attempted. A targeted plan runs a subset against an incomplete graph, which is why it looks tidy and proves little. After a lost state there is nothing left to target, which is one small mercy of this drill and not a technique to reuse.
Figure 6 is the verification route, from a stopped apply to a signed closure.
%%{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','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#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','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
A["Apply exits 1 mid-graph"] --> B["Freeze the state key
list every writer"]
B --> C["Copy the log and the saved plan
record a hash for each"]
C --> D{"Is there a snapshot with a matching lineage
and a timestamp before the first bad write?"}
D -->|"yes"| E["Restore the backend version
to a copy first, then promote"]
D -->|"no"| F["Rebuild ownership in a recovery root
from the tag inventory"]
E --> G["plan -refresh-only
adjudicate every row"]
F --> G
G --> H{"Normal plan exits 0?"}
H -->|"no"| I["Configuration still describes the old shape"]
I --> G
H -->|"yes"| J["Count check: six addresses, six ledger identities"]
J --> K{"Does the other root also plan clean?"}
K -->|"yes"| L["Close D2 and D5, record the serial"]
K -->|"no"| M["Two owners or one duplicate name"]
M --> 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 D,H,K primary;
class A,B,C,E,F,G secondary;
class L ok;
class I,M warn;
Recovery rebuilds ownership, not history. Create a separate root with its own state key, import each object from the ledger identity, and plan until nothing is proposed. The count is the second test: six addresses against six ledger identities, and one live object per ledger row when you read the provider.
Cutover has two honest forms, and the record chooses one. Promote the recovery state to the production key, accepting a new lineage, or keep the production key and re-import there under the same freeze, keeping the history continuous. The first is cleaner after a total loss; the second preserves the serial chain. State which one you did and why.
Two acceptance criteria incidents usually omit. Measure the rehearsal's duration from freeze to first no-change plan, because a runbook that promises thirty minutes and takes ninety has a defect. And have someone who was not in the incident read D5 and reproduce the decision, because a recovery only one person can explain is not yet a runbook.
The recommendation belongs in the incident file. This fixture used a local state file with no version history, which is why the snapshot branch was unavailable. The fix is a versioned backend with a lock, recorded as a follow-up with an owner and a date, not as a lesson in the postmortem.
Submit the Migration and Incident Evidence
Snapshots are photographs of a record; the package is the argument about the estate. A state copy proves what Terraform believed at one moment. It does not prove the cloud matches, that addresses are the intended ones, or that a second root is not claiming the same object.
Six deliverables, each falsifiable by someone else. The reviewer should be able to reject any one of them without redoing the work.
| Deliverable | Artifact | What it proves | What it cannot prove |
|---|---|---|---|
| D1 Inventory | Ledger with ids, shapes, owners, target roots, one exclusion | The scope of the migration | That the cloud is unchanged since the timestamp |
| D2 Baseline | Six import proofs plus one combined no-change plan | Configuration describes the objects as they exist | That the addresses are the final ones |
| D3 Refactor | Move annotations, zero-change summaries, negative control | Infrastructure did not move, only the record | That ownership is split correctly for the future |
| D4 Drift | Record with values, actor, decision, approver, expiry | One console change has an ending | That no other drift exists |
| D5 Incident | Writer control, timeline, evidence hashes, recovery decision | The recovery was controlled and reproducible | That the lost state matched the cloud |
| D6 Memo | Reviewer's statement and the conditions that would falsify it | An independent party accepted the argument | Anything the reviewer did not read |
The reviewer needs comparisons, and a folder of artifacts is not one. Six import plans prove nothing if nobody compares each summary to its expected shape. A no-change exit code proves nothing if the plan was run before the last import. A count proves nothing if the ledger was edited to match it.
Put the argument on one page and the evidence behind it. A reviewer reads the memo, the falsifier and the count first; the summaries are the appendix. A package ordered by command history makes the reviewer reconstruct the argument, and reconstruction is precisely what the capstone is meant to remove.
The state copies leave the package with an expiry. Keep the hashes and the summaries; keep the raw state only in restricted storage with a deletion date. A migration package that becomes an unmanaged copy of every attribute in the estate is a second incident waiting for a folder permission.
Cleanup is part of the argument. Destroy the data root, destroy the platform root, confirm both plans are empty, then delete the excluded log group outside Terraform because nothing ever owned it. Revoke the temporary credentials, delete the generated drafts, and keep D1 to D6 plus the runbook, not the state files.
The review is adversarial on purpose. The card below is the acceptance session: the reviewer runs the checks in order, records a pass or a fail per line, and stops at the first fail rather than reading the rest.
Brownfield acceptance review
Status: design-only. The review sequence was not executed for this article. It is written against Terraform 1.17.1 and hashicorp/aws 6.72.0, checked on 6 November 2026, in a disposable account.
Prerequisites. A completed D1 to D6 package, a reviewer who did not build the fixture, a read-only credential for the sandbox account, and the fixture still running so the checks have something to read.
Setup. Place the package in one directory: the ledger, the plan summaries, the refactor evidence, the drift record, the incident file and the memo. Nothing in the package may be a state file or a credential.
- Scope. Read the ledger's first and last row, the exclusion and its expiry, and the timestamp. Reject if the exclusion has no reason or the timestamp is absent.
- Identity. Pick two rows and read the provider id from the cloud yourself. Reject if either differs from the ledger by a single character.
- Baseline. Read the six summaries and confirm each says one import and nothing else. Then run a normal plan in the platform root and require exit code 0.
- Refactor. Find the move annotations in the saved plan output and the zero-change summary beside them. Then confirm the negative control shows a create and a destroy.
- Ownership. Run the state listing in both roots and count the addresses. Six imported addresses, no object listed twice, and the table present only in the data root.
- Drift. Read the record and check the decision against the current remote value. Reject if the plan is quiet but the state was never refreshed, or if the record has no approver.
- Incident. Read the writer list and confirm every entry has a closure time. Then confirm the recovery plan exits 0 and the live object count matches the ledger.
- Falsifier. Ask the reviewer to write one sentence naming what would make the package wrong, and whether that check was run.
Expected observation. Eight passes, each with an artifact reference, and one written falsifier that the reviewer actually tested. A package that cannot produce the falsifier sentence has not been reviewed; it has been received.
| Check | Pass condition | Typical fail |
|---|---|---|
| Scope | Every row has four filled columns | A target root that says "later" |
| Identity | Two spot checks match the cloud | An id rebuilt from a name pattern |
| Baseline | Six import-only summaries, one exit 0 | A summary with an update riding along |
| Refactor | Move annotations, zero changes, control shows create plus destroy | A replacement hidden in the move |
| Ownership | Six addresses, none duplicated | The table in both roots |
| Drift | Decision matches the remote value and the refreshed serial | A quiet plan with stale state |
| Incident | Writer closures, exit 0, count match | A force-unlock with no named holder |
| Falsifier | One sentence, actually tested | "Looks good" |
Cost dimensions. One bucket trio, two queues and one on-demand table for a session; requests dominate and storage is bytes. Set a ceiling of a few dollars in D1 and stop at it. The expensive part is the account and the teardown, which is why the fixture is disposable.
Cleanup. Destroy both roots, confirm both plans are empty, delete the unowned log group by tag, delete saved plans and drafts, and keep the six deliverables and the runbook after the state copies expire.