From aws-cdk
Develops AWS infrastructure as code with CDK in TypeScript/Python. Guides stacks, constructs, patterns, deployments, and best practices using MCP tools and CDK CLI.
npx claudepluginhub zxkane/aws-skills --plugin aws-cdkThis skill is limited to using the following tools:
This skill provides comprehensive guidance for developing AWS infrastructure using the Cloud Development Kit (CDK), with integrated MCP servers for accessing latest AWS knowledge and CDK utilities.
Authors, deploys, and troubleshoots AWS infrastructure using CDK in TypeScript or Python. Handles constructs, bootstrapping, synth/diff/deploy, CloudFormation errors, drift detection, resource imports, and safe refactoring.
Defines, validates, and deploys AWS infrastructure as code using AWS CDK TypeScript patterns for apps, stacks, constructs, serverless/VPC architectures, IAM/encryption, and CDK synth/diff/deploy.
Builds well-architected AWS infrastructure with CDK and CloudFormation using docs, samples, cfn-lint validation, cfn-guard compliance, best practices, and troubleshooting. Use for CDK, CloudFormation, cfn-lint, cfn-guard, AWS IaC.
Share bugs, ideas, or general feedback.
This skill provides comprehensive guidance for developing AWS infrastructure using the Cloud Development Kit (CDK), with integrated MCP servers for accessing latest AWS knowledge and CDK utilities.
Always verify AWS facts using MCP tools (mcp__aws-mcp__* or mcp__*awsdocs*__*) before answering. The aws-mcp-setup dependency is auto-loaded — if MCP tools are unavailable, guide the user through that skill's setup flow.
This skill includes the CDK MCP server automatically configured with the plugin:
When to use: For CDK-specific guidance and utilities
Important: Leverage this server for CDK construct guidance and advanced CDK operations.
Use this skill when:
CRITICAL: Do NOT explicitly specify resource names when they are optional in CDK constructs.
Why: CDK-generated names enable:
Pattern: Let CDK generate unique names automatically using CloudFormation's naming mechanism.
// ❌ BAD - Explicit naming prevents reusability and parallel deployments
new lambda.Function(this, 'MyFunction', {
functionName: 'my-lambda', // Avoid this
// ...
});
// ✅ GOOD - Let CDK generate unique names
new lambda.Function(this, 'MyFunction', {
// No functionName specified - CDK generates: StackName-MyFunctionXXXXXX
// ...
});
Security Note: For different environments (dev, staging, prod), follow AWS Security Pillar best practices by using separate AWS accounts rather than relying on resource naming within a single account. Account-level isolation provides stronger security boundaries.
Use the appropriate Lambda construct based on runtime:
TypeScript/JavaScript: Use @aws-cdk/aws-lambda-nodejs
import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
new NodejsFunction(this, 'MyFunction', {
entry: 'lambda/handler.ts',
handler: 'handler',
// Automatically handles bundling, dependencies, and transpilation
});
Python: Use @aws-cdk/aws-lambda-python
import { PythonFunction } from '@aws-cdk/aws-lambda-python-alpha';
new PythonFunction(this, 'MyFunction', {
entry: 'lambda',
index: 'handler.py',
handler: 'handler',
// Automatically handles dependencies and packaging
});
Benefits:
Use a multi-layer validation strategy for comprehensive CDK quality checks:
For TypeScript/JavaScript projects:
Install cdk-nag for synthesis-time validation:
npm install --save-dev cdk-nag
Add to your CDK app:
import { Aspects } from 'aws-cdk-lib';
import { AwsSolutionsChecks } from 'cdk-nag';
const app = new App();
Aspects.of(app).add(new AwsSolutionsChecks());
Optional - VS Code users: Install CDK NAG Validator extension for faster feedback on file save.
For Python/Java/C#/Go projects: cdk-nag is available in all CDK languages and provides the same synthesis-time validation.
Synthesis with cdk-nag: Validate stack with comprehensive rules
cdk synth # cdk-nag runs automatically via Aspects
Suppress legitimate exceptions with documented reasons:
import { NagSuppressions } from 'cdk-nag';
// Document WHY the exception is needed
NagSuppressions.addResourceSuppressions(resource, [
{
id: 'AwsSolutions-L1',
reason: 'Lambda@Edge requires specific runtime for CloudFront compatibility'
}
]);
Build: Ensure compilation succeeds
npm run build # or language-specific build command
Tests: Run unit and integration tests
npm test # or pytest, mvn test, etc.
Validation Script: Meta-level checks
./scripts/validate-stack.sh
The validation script now focuses on:
Always verify before implementing:
Example scenarios:
Leverage for CDK-specific guidance:
Example scenarios:
For detailed CDK patterns, anti-patterns, and architectural guidance, refer to the comprehensive reference:
File: references/cdk-patterns.md
This reference includes:
scripts/validate-stack.sh - Pre-deployment validationreferences/cdk-patterns.md - Detailed pattern libraryWhen GitHub Actions workflow files exist in the repository, ensure all checks defined in .github/workflows/ pass before committing. This prevents CI/CD failures and maintains code quality standards.