| name | aws-cdk-analyzer |
| description | Analyze AWS CDK applications for best practices, security, cost optimization, and deployment safety — covers construct patterns, IAM policies, and CloudFormation output. |
| metadata | {"tags":["aws","cdk","infrastructure","cloud","security","iac"]} |
AWS CDK Analyzer
Analyze AWS CDK applications for best practices, security vulnerabilities, cost optimization, and deployment safety. Reviews construct patterns, IAM policies, resource configurations, and synthesized CloudFormation output. Use when reviewing CDK code, preparing for production deployments, or auditing existing infrastructure.
Usage
"Analyze my CDK app for security issues"
"Review the IAM policies in my CDK stacks"
"Check my CDK code for cost optimization opportunities"
"Audit the CDK constructs for best practices"
"Verify deployment safety for this CDK change"
How It Works
1. Project Discovery
Map the CDK application structure:
cat package.json | python3 -c "
import json, sys
d = json.load(sys.stdin)
for key in ['aws-cdk-lib', 'aws-cdk', '@aws-cdk/core']:
ver = d.get('dependencies', {}).get(key) or d.get('devDependencies', {}).get(key)
if ver: print(f'CDK: {key}@{ver}')
"
grep -rn "extends Stack\|new Stack\|class.*Stack" lib/ bin/ src/ 2>/dev/null
find lib/ src/ -name "*.ts" -o -name "*.py" | head -30