Claude Code runs terraform destroy on DataTalks.Club production infrastructure
Claude Code, working through Terraform for Alexey Grigorev, destroyed the production infrastructure behind the DataTalks.Club course platform, including its database and snapshots.
On 26 February 2026 Alexey Grigorev, founder of DataTalks.Club, was adding a second site to his AWS Terraform setup with Claude Code. His Terraform state was on his old computer, so the first plan wanted to recreate everything; he stopped it, then had Claude clean up the duplicates. When he moved an archive of the old Terraform folder across, Claude unpacked it over the current state, then ran terraform destroy, which removed the course platform's database, network, cluster and automated snapshots, covering 2.5 years of records. AWS support restored a snapshot about 24 hours later. Grigorev wrote it up on 6 March, blaming his own over-reliance on the agent, and no longer lets it run commands.
- 8 days
- 0 days
- The handler
- The damage
What happened
Grigorev lets Claude Code plan and apply Terraform for a new site on the shared setup
He was adding AI Shipping Labs to the Terraform setup that already ran the DataTalks.Club course platform. Claude advised a separate setup; he declined to save a few dollars a month. His state file was still on his old computer, so Terraform saw nothing and began creating duplicates. He stopped it, but some resources already existed.
Claude Code runs terraform destroy against the real production state
While Claude was cleaning up duplicates, Grigorev moved an archive of the old Terraform folder to the new machine. He says he did not notice Claude unpack it over the current state file. Claude then ran terraform destroy and removed the VPC, the RDS database, the ECS cluster, load balancers, the bastion host and the automated snapshots.
Reports differ
Grigorev finds the database gone and no usable snapshot
He expected a 2 AM nightly snapshot and found none in the console; an event log showed a 00:24 backup that could not be opened. Roughly 1.94 million rows in one table, and 2.5 years of course data, were at stake.
AWS support confirms the deletion and finds a snapshot on its side
Grigorev upgraded to AWS Business Support, got a reply in about 40 minutes, and was told the database and snapshots were deleted by the API request. AWS found a snapshot not visible in his console.
AWS restores the snapshot about 24 hours after the deletion
The platform came back after Grigorev rebuilt the database from the restored snapshot and checked the row count.
Reports differ
Grigorev publishes his post-mortem
'How I Dropped Our Production Database and Now Pay 10% More for AWS' on his newsletter, listing the changes he made.
Tom's Hardware covers the incident
Syndicated on Yahoo Tech on 7 March 2026.
Agent failures
Destructive action
Destructive action
How it was found
Found first by the handler, from the damage
- The handler
- The damage
- 8 days
Grigorev saw the database missing in the AWS console and found no snapshot to restore. Nothing flagged the destroy before it ran. The one check that existed was his own approval, and he says he gave it without noticing that the state file had changed.
What is publicly known
4 of 12 fully public
| Item | Public? | Detail | Sources |
|---|---|---|---|
| Partial | Claude Code. No model name or version appears in the post. | ||
| Unknown | No source mentions reasoning settings. | ||
| Weak | Grigorev's own review of the plan was the check, and he had delegated it. Post-incident he disabled automatic execution and file writes. Whether Claude Code ran in a permission-skipping mode is not stated in the post. | ||
| Unknown | Not published. | ||
| Known | Deploy changes for a second site with Terraform, then remove the duplicate resources Terraform had created. Described step by step in the post. | ||
| Partial | Claude Code on a new laptop with AWS access, able to run Terraform and the AWS CLI. Permission settings are not fully described. | ||
| Unknown | No source describes network setup beyond direct AWS access. | ||
| Weak | The post paraphrases the exchange and quotes a few lines; no full session log. | ||
| Weak | Grigorev found the loss himself. AWS support later confirmed from its side that an API request deleted the database and snapshots. | ||
| Known | Production infrastructure for the course platform deleted, including the RDS database and snapshots; about 1.94 million rows in one table checked after restore. Roughly a day of downtime and about 10% more on his AWS bill. | ||
| Known | Missing local state led to duplicates; the state file for production was then unpacked over the working state, and the destroy ran against it. Grigorev names over-reliance on the agent and untested backups. | ||
| Known | Terraform and AWS delete protection, backups outside the database and Terraform, remote state in S3, nightly restore test, no automatic agent execution. Self-reported. |
Controls that apply
Protect
Detect
Recover
- All controls →