Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

AWS CDK CLI

$ cdk Official High Risk
Amazon Web Services · Cloud & Infra · Apache-2.0 · macos / linux / windows

AWS CDK CLI (cdk) synthesizes TypeScript, Python, Go, Java, or C# infrastructure code into CloudFormation templates (cdk synth), previews exact infrastructure changes (cdk diff), and deploys stacks with configurable IAM approval gates.

FCRS-1.0 Score
84 /100
Good
Medium Confidence
Zero-Friction Install
npm install -g aws-cdk
CLI vs MCP Decision CLI Preferred vs MCP

cdk executes local project code to run synth and diff, making local CLI execution essential over remote MCP.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 19 / 25

Supports --ci, --no-color, and machine-readable cdk.out CloudFormation JSON artifacts, though cdk diff stdout is human-formatted.

  • Supports --ci, --no-color, and JSON template synthesis in cdk.out
Trust & Safety 21 / 25

cdk synth is 100% local, cdk diff shows exact changes, and --require-approval broadening blocks unexpected IAM expansion.

  • Built-in --require-approval IAM safety check and cdk diff
Setup & Portability 13 / 15

Easy npm install -g aws-cdk or npx aws-cdk invocation, though project language runtimes must also be installed.

  • Official npm aws-cdk package and npx support
Utility & Efficiency 13 / 15

Bridges high-level TypeScript/Python IaC directly to CloudFormation.

  • Synthesizes and diffs multi-stack AWS apps
Maintenance & Lineage 10 / 10

First-party AWS tool (aws/aws-cdk-cli) updated continuously.

  • Official AWS CDK CLI under Apache-2.0
Docs & Verifiability 8 / 10

Detailed CDK Developer Guide and --help flags.

  • AWS CDK v2 CLI reference

Security, Auth & Guardrails

Auth Modes
Config File Env API Key OAuth Browser
Credential Storage

Reads standard AWS credentials from ~/.aws/credentials, AWS_PROFILE, or environment keys.

Side Effects
Read-Only Local Write Remote Write Destructive Billing Impact
Cost & Quotas

CLI is free (Apache-2.0); deployed AWS stacks incur cloud billing.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# AWS CDK Agent Rules
- ALWAYS run `cdk synth --no-color --ci` and `cdk diff --no-color --ci` before any deploy.
- Keep `--require-approval broadening` (default) enabled; never pass `--require-approval never` automatically.
- Avoid `cdk destroy` without explicit user confirmation.

Agent-Ready Command Recipes

Safe Read-Only Queries

Synthesize CloudFormation templates locally
cdk synth --no-color --ci

Compiles CDK constructs into cdk.out/ CloudFormation JSON/YAML with zero AWS mutations.

Diff local CDK code against deployed stacks
cdk diff --no-color --ci

Previews resource additions, replacements, and IAM policy changes before deployment.

Controlled Writes & Previews

Deploy only with explicit stack name and non-broadening approval
cdk deploy MyAppStack --require-approval broadening --ci --no-color

Aborts automatically if IAM permissions would broaden unless approved.

Strengths for Agents

  • + cdk synth and cdk diff provide clear pre-deployment verification.
  • + --require-approval broadening blocks silent IAM privilege escalation.
  • + --ci and --no-color cleanly format output for non-TTY logs.

Caveats & Pitfalls

  • ! cdk diff and cdk deploy lack a --json structured output mode.
  • ! Requires matching Node.js plus the CDK app's target language runtime.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI