# Break the lab on purpose

The happy path already works. Interviewers ask about the stall. Do these three after a successful demo. Then put the lab back and destroy it the same day.

![Three lab stalls to name in interview](/sprint-content/diagrams/lab-failure.svg)

## Drill 1 — EventBridge cannot write encrypted SQS

**What you change:** On the lab CMK (customer-managed KMS key), remove `events.amazonaws.com` from the key policy. Upload one more file.

**What you see:** Ingest still returns 202 (accepted, not finished). The object is in S3. DynamoDB stays `RECEIVED`. The process queue is empty. Processor logs are quiet. DLQ (dead-letter queue for failed messages) is empty — the message never arrived.

**Why:** EventBridge (the AWS event bus) must call `kms:GenerateDataKey*` on that CMK to send to an encrypted queue. IAM on Lambda does not fix this.

**Put it back:** Restore the service statement. Re-upload. Status becomes `PROCESSED`.

**Say this out loud:** “The object in S3 with a stuck RECEIVED row is usually KMS on the bus, not a Python bug.”

## Drill 2 — Reserved concurrency 0

**What you change:** Set the processor reserved concurrency to 0 (no processor runs). Upload one file.

**What you see:** 202 still returns. Object lands. Queue depth grows. Processor does not invoke. After enough receives you may get DLQ, or the queue just sits.

**Why:** Reserved concurrency 0 is a deploy-time mute. It looks like an outage with no 5xx on ingest.

**Put it back:** Set reserved concurrency to 5. Messages drain.

**Say this out loud:** “I will check reserved concurrency before I rewrite the handler.”

## Drill 3 — Encoded S3 key

**What you change:** Temporarily comment out `unquote_plus` (decode the S3 key) in `processor.py`. Redeploy that function only. Upload a file named `my file.txt` (space in the name).

**What you see:** Ingest 202. S3 object exists. Processor throws / retries. After 3 receives the message is on the DLQ. CloudWatch shows `NoSuchKey` or a 404-style GetObject.

**Why:** EventBridge/S3 encode spaces. GetObject needs the decoded key.

**Put it back:** Restore `unquote_plus`, redeploy, replay from the DLQ or upload again.

**Say this out loud:** “I unquote the key before GetObject. I do not ask the client to POST again.”

## Cleanup

`terraform destroy` the same day. Do not leave a broken concurrency setting in the account.
