Infra Plan Readback

Infra Plan Readback is a copy-paste React component that stops helps prevent terraform apply destroying a production database before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/infra-plan-readback
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsHelps prevent terraform apply destroying a production database

Was this component page useful?

How do I install Infra Plan Readback?

pnpm dlx shadcn@latest add @bollard/infra-plan-readback

The files land in your project. They're yours to edit.

How do I use Infra Plan Readback in React?

infra-plan-readback-usage.tsx
import { InfraPlanReadback } from "@/components/ui/infra-plan-readback"

<InfraPlanReadback plan={PLAN} workspace="prod-eu" onApply={() => new Promise<void>((resolve) => setTimeout(() => (setApplied(true), resolve()), 800))} />

What input mistakes does Infra Plan Readback catch?

  • Destroys and replacements of databases, buckets, volumes and keys, listed first
  • The attribute that forces a replacement (before → after, sensitive values hidden)
  • Destroy-before-create replacements that leave a gap
  • force_destroy and skip_final_snapshot consequences
  • Production workspace, or var.environment saying production when the workspace doesn't

What props does Infra Plan Readback accept?

InfraPlanReadback props
PropTypeDefault
plan* (required)

`terraform show -json <planfile>` output, parsed or as text.

unknown—
workspace

Workspace name (`terraform workspace show`) or an environment label.

string—
production

Force production handling on or off. Defaults to reading the workspace name and var.environment.

boolean—
statefulTypes

More resource types that hold data.

string[]—
isStateful

Your own stateful test; overrides the built-in list.

(type: string) => boolean—
onApply

Called on Apply. May return a Promise; shows a pending state and ignores repeat clicks.

() => void | Promise<void>—
messages

Any visible string; `actions` may be partial.

Partial<Omit<InfraPlanMessages, "actions">> & { actions?: Partial<InfraPlanMessages["actions"]> }—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Infra Plan Readback accessible?

  • Parse errors and unappliable plans use role=alert
  • Data-loss list is a labelled section with a checkbox label per item
  • Workspace confirmation input has a visible label
  • Status uses role=status; sign icons are aria-hidden with the action named in text

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Protect production state with policy checks (OPA/Sentinel), prevent_destroy and deletion protection, and require reviewed plans in CI.

  • Only as good as the plan JSON; a plan made against stale state or a different workspace isn't detected
  • Stateful detection uses a built-in type list plus your statefulTypes/isStateful
  • The lock is in this UI; terraform apply from a terminal or CI is not affected

What expensive mistakes does Infra Plan Readback stop?

Helps prevent terraform apply destroying a production database

Also known as

terraform plan · terraform apply · opentofu · iac · infra · aws rds · s3 bucket · devops

Field type

What dependencies does Infra Plan Readback require?

Infra Plan Readback facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameInfra Plan Readback
Registry identifier@bollard/infra-plan-readback
Install commandnpx shadcn@latest add @bollard/infra-plan-readback
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Infra Plan Readback

How does Infra Plan Readback protect destructive mutations?

Infra Plan Readback prevents terraform apply destroying a production database. Enforces deliberate friction against Destroys and replacements of databases, buckets, volumes and keys, listed first, The attribute that forces a replacement (before → after, sensitive values hidden), Destroy-before-create replacements that leave a gap, force_destroy and skip_final_snapshot consequences, Production workspace, or var.environment saying production when the workspace doesn't. Limitation: authorize infra-plan-readback mutations on the server.

How do I install infra-plan-readback with shadcn?

Run `npx shadcn@latest add @bollard/infra-plan-readback`. Sources added: registry/default/infra-plan-readback/infra-plan-readback.tsx, registry/default/infra-plan-readback/plan.ts. Package requirements: lucide-react.

What props customize Infra Plan Readback?

Infra Plan Readback accepts `plan`, `workspace`, `production`, `statefulTypes`, `isStateful`. Configures terraform plan, terraform apply, opentofu behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of infra-plan-readback?

Only as good as the plan JSON; a plan made against stale state or a different workspace isn't detected. Stateful detection uses a built-in type list plus your statefulTypes/isStateful. The lock is in this UI; terraform apply from a terminal or CI is not affected Server requirement: Protect production state with policy checks (OPA/Sentinel), prevent_destroy and deletion protection, and require reviewed plans in CI.

How does Infra Plan Readback meet accessibility guidelines?

Parse errors and unappliable plans use role=alert. Data-loss list is a labelled section with a checkbox label per item. Workspace confirmation input has a visible label. Status uses role=status; sign icons are aria-hidden with the action named in text. Minimizes errors: terraform destroyed my database, apply replaced rds instance.

Which components pair with Infra Plan Readback?