MCP HubMCP Hub
SKILL·947A75

aws-cdk-development

zxkane
Mis à jour 16 days ago
326
36
326
Voir sur GitHub
Métaautomationdesign

À propos

Cette compétence fournit une expertise en AWS CDK pour construire une infrastructure cloud avec TypeScript/Python, couvrant la création de stacks, les modèles de constructs et les workflows de déploiement. Utilisez-la lors de l'implémentation d'infrastructure en tant que code, du travail avec CDK/CloudFormation, ou pour obtenir de l'aide avec les commandes cdk synth/déploy. Elle inclut des outils AWS intégrés et un contexte automatisé pour un développement rationalisé.

Installation rapide

Claude Code

Recommandé
Principal
npx skills add zxkane/aws-skills -a claude-code
Commande PluginAlternatif
/plugin add https://github.com/zxkane/aws-skills
Git CloneAlternatif
git clone https://github.com/zxkane/aws-skills.git ~/.claude/skills/aws-cdk-development

Copiez et collez cette commande dans Claude Code pour installer cette compétence

Documentation

AWS CDK Development

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.

AWS Documentation Requirement

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.

CDK-Specific MCP Guidance

AWS Labs replaced the dedicated CDK MCP server (awslabs.cdk-mcp-server) with the broader awslabs.aws-iac-mcp-server, which covers CDK alongside CloudFormation and other AWS infrastructure-as-code workflows.

For CDK construct lookups, best-practice recommendations, and pattern guidance, install awslabs.aws-iac-mcp-server. It ships in the deploy-on-aws plugin from awslabs/agent-plugins, or can be registered directly with claude mcp add aws-iac uvx awslabs.aws-iac-mcp-server@latest.

When to reach for it:

  • CDK construct recommendations and API lookups
  • CDK and CloudFormation best-practice patterns
  • Validation of synthesized templates
  • Cross-resource configuration guidance

When to Use This Skill

Use this skill when:

  • Creating new CDK stacks or constructs
  • Refactoring existing CDK infrastructure
  • Implementing Lambda functions within CDK
  • Following AWS CDK best practices
  • Validating CDK stack configurations before deployment
  • Verifying AWS service capabilities and regional availability

Core CDK Principles

Resource Naming

CRITICAL: Do NOT explicitly specify resource names when they are optional in CDK constructs.

Why: CDK-generated names enable:

  • Reusable patterns: Deploy the same construct/pattern multiple times without conflicts
  • Parallel deployments: Multiple stacks can deploy simultaneously in the same region
  • Cleaner shared logic: Patterns and shared code can be initialized multiple times without name collision
  • Stack isolation: Each stack gets uniquely identified resources automatically

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.

Lambda Function Development

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:

  • Automatic bundling and dependency management
  • Transpilation handled automatically
  • No manual packaging required
  • Consistent deployment patterns

Pre-Deployment Validation

Use a multi-layer validation strategy for comprehensive CDK quality checks:

Layer 1: Real-Time IDE Feedback (Recommended)

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.

Layer 2: Synthesis-Time Validation (Required)

  1. Synthesis with cdk-nag: Validate stack with comprehensive rules

    cdk synth  # cdk-nag runs automatically via Aspects
    
  2. 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'
      }
    ]);
    

Layer 3: Pre-Commit Safety Net

  1. Build: Ensure compilation succeeds

    npm run build  # or language-specific build command
    
  2. Tests: Run unit and integration tests

    npm test  # or pytest, mvn test, etc.
    
  3. Validation Script: Meta-level checks

    ./scripts/validate-stack.sh
    

The validation script now focuses on:

  • Language detection
  • Template size and resource count analysis
  • Synthesis success verification
  • (Note: Detailed anti-pattern checks are handled by cdk-nag)

Workflow Guidelines

Development Workflow

  1. Design: Plan infrastructure resources and relationships
  2. Verify AWS Services: Use AWS Documentation MCP to confirm service availability and features
    • Check regional availability for all required services
    • Verify service limits and quotas
    • Confirm latest API specifications
  3. Implement: Write CDK constructs following best practices
    • Use CDK MCP server for construct recommendations
    • Reference CDK best practices via MCP tools
  4. Validate: Run pre-deployment checks (see above)
  5. Synthesize: Generate CloudFormation templates
  6. Review: Examine synthesized templates for correctness
  7. Deploy: Deploy to target environment
  8. Verify: Confirm resources are created correctly

Stack Organization

  • Use nested stacks for complex applications
  • Separate concerns into logical construct boundaries
  • Export values that other stacks may need
  • Use CDK context for environment-specific configuration

Testing Strategy

  • Unit test individual constructs
  • Integration test stack synthesis
  • Snapshot test CloudFormation templates
  • Validate resource properties and relationships

Using MCP Servers Effectively

When to Use AWS Documentation MCP

Always verify before implementing:

  • New AWS service features or configurations
  • Service availability in target regions
  • API parameter specifications
  • Service limits and quotas
  • Security best practices for AWS services

Example scenarios:

  • "Check if Lambda supports Python 3.13 runtime"
  • "Verify DynamoDB is available in eu-south-2"
  • "What are the current Lambda timeout limits?"
  • "Get latest S3 encryption options"

When to Use CDK MCP Server

Leverage for CDK-specific guidance:

  • CDK construct selection and usage
  • CDK API parameter options
  • CDK best practice patterns
  • Construct property configurations
  • CDK-specific optimizations

Example scenarios:

  • "What's the recommended CDK construct for API Gateway REST API?"
  • "How to configure NodejsFunction bundling options?"
  • "Best practices for CDK stack organization"
  • "CDK construct for DynamoDB with auto-scaling"

MCP Usage Best Practices

  1. Verify First: Always check AWS Documentation MCP before implementing new features
  2. Regional Validation: Check service availability in target deployment regions
  3. CDK Guidance: Use CDK MCP for construct-specific recommendations
  4. Stay Current: MCP servers provide latest information beyond knowledge cutoff
  5. Combine Sources: Use both skill patterns and MCP servers for comprehensive guidance

CDK Patterns Reference

For detailed CDK patterns, anti-patterns, and architectural guidance, refer to the comprehensive reference:

File: references/cdk-patterns.md

This reference includes:

  • Common CDK patterns and their use cases
  • Anti-patterns to avoid
  • Security best practices
  • Cost optimization strategies
  • Performance considerations

Additional Resources

  • Validation Script: scripts/validate-stack.sh - Pre-deployment validation
  • CDK Patterns: references/cdk-patterns.md - Detailed pattern library
  • AWS Documentation MCP: Integrated for latest AWS information
  • CDK MCP Server: Integrated for CDK-specific guidance

GitHub Actions Integration

When 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.

Dépôt GitHub

zxkane/aws-skills
Chemin: plugins/aws-iac/skills/aws-cdk-development
0
agent-skillsanthropicawsaws-agentcoreaws-cdkaws-cost-optimization
FAQ

Frequently asked questions

What is the aws-cdk-development skill?

aws-cdk-development is a Claude Skill by zxkane. Skills package instructions and resources that Claude loads on demand, so Claude can perform aws-cdk-development-related tasks without extra prompting.

How do I install aws-cdk-development?

Use the install commands on this page: add aws-cdk-development to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.

What category does aws-cdk-development belong to?

aws-cdk-development is in the Meta category, tagged automation and design.

Is aws-cdk-development free to use?

Yes. aws-cdk-development is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.

Compétences associées

content-collections
Méta

Cette compétence propose une configuration éprouvée en production pour Content Collections, un outil axé sur TypeScript qui transforme des fichiers Markdown/MDX en collections de données typées de manière sûre avec une validation Zod. Utilisez-la lors de la création de blogs, de sites de documentation ou d'applications Vite + React riches en contenu pour garantir la sécurité de typage et la validation automatique du contenu. Elle couvre tout, de la configuration du plugin Vite et de la compilation MDX à l'optimisation des déploiements et la validation des schémas.

Voir la compétence
polymarket
Méta

Cette compétence permet aux développeurs de créer des applications avec la plateforme de marchés prédictifs Polymarket, incluant l'intégration d'API pour le trading et les données de marché. Elle fournit également une diffusion de données en temps réel via WebSocket pour surveiller les transactions en direct et l'activité du marché. Utilisez-la pour mettre en œuvre des stratégies de trading ou pour créer des outils traitant les mises à jour de marché en direct.

Voir la compétence
creating-opencode-plugins
Méta

Cette compétence aide les développeurs à créer des plugins OpenCode qui s'interconnectent avec plus de 25 types d'événements tels que les commandes, les fichiers et les opérations LSP. Elle fournit la structure du plugin, les spécifications de l'API événementielle et les modèles d'implémentation pour les modules JavaScript/TypeScript. Utilisez-la lorsque vous avez besoin d'intercepter, de surveiller ou d'étendre le cycle de vie de l'assistant IA OpenCode avec une logique personnalisée pilotée par les événements.

Voir la compétence
sglang
Méta

SGLang est un framework de service LLM haute performance spécialisé dans la génération rapide et structurée pour les workflows JSON, regex et agentiques grâce à son cache de préfixe RadixAttention. Il offre une inférence nettement plus rapide, particulièrement pour les tâches avec des préfixes répétés, ce qui le rend idéal pour les sorties complexes et structurées ainsi que les conversations multi-tours. Choisissez SGLang plutôt que des alternatives comme vLLM lorsque vous avez besoin d'un décodage contraint ou que vous construisez des applications avec un partage étendu de préfixes.

Voir la compétence