aws-deployment-preflightlisted
Install: claude install-skill eric-sabe/engsys
# AWS Deployment Preflight
The AWS analogue of pre-deploy validation: validate locally and clean up state
*before* you deploy, so CI doesn't discover what you could have caught. Works for
both AWS CDK projects and raw CloudFormation. Continue through all steps even if one
fails — capture every issue, then fix them in a batch.
> Discipline: **batch your fixes.** Each deploy/CI run costs real minutes. Read the
> whole failing stack, reason about every issue, fix them all, push once. One run per
> problem cluster, not one per error message.
## When to use
- Before `cdk deploy`, `cdk destroy`, `aws cloudformation deploy/create-stack`.
- When preparing or reviewing CDK / CloudFormation templates.
- To preview what a deploy will change.
- After a failed deploy left a stack stuck (`ROLLBACK_COMPLETE`, `*_FAILED`).
- Before an "it worked yesterday" infra mystery becomes a CI run.
## Step 1 — Detect project type
- **CDK project:** `cdk.json` at root; stacks in `bin/` + `lib/` (TS) or app entry
(Python). Identify the app and stack names: `cdk list`.
- **Raw CloudFormation:** `.yaml`/`.json` templates (`AWSTemplateFormatVersion`,
`Resources:`), often under `infra/`, `cloudformation/`, `templates/`.
- Confirm the target account/region: `aws sts get-caller-identity` and
`aws configure get region` (or `$AWS_REGION`). Deploying to the wrong account is the
most expensive mistake of all.
## Step 2 — Validate the template
### CDK
```bash
# Synthesize — fails on construct/TypeS