No warning. No second chance. A single command, meant to clean up stale files, had wiped critical data before anyone noticed. This is how data loss happens with the AWS CLI—fast, silent, and irreversible.
The AWS CLI is powerful. It’s also unforgiving. A wrong flag in aws s3 rm or aws s3 sync can delete entire directories. A missing --exclude or a misplaced --recursive wipes days, weeks, or years of work. And because these commands run over secure API calls, there’s no Trash, no Undo.
Many incidents happen because developers trust a single command to “just work.” But there are hidden risks:
- Wildcards that match more files than expected.
- Sync operations erasing the wrong side of the transfer.
- Accidentally targeting
productioninstead ofstaging. - Automation scripts that run without dry-run checks.
The problem grows when teams rely on IAM roles with broad permissions. A script running under an admin role has the keys to everything. One error propagates across multiple buckets. Replication won’t save you—it simply deletes in two places instead of one.