Skill

Build AWS Infrastructure with CDK Best Practices

An AWS CDK skill covering naming conventions, Lambda constructs, three-layer validation with cdk-nag, and MCP-verified AWS facts.

Works with awscdkcloudformationlambdagithub

75
Spark score
out of 100
Updated 2 days ago
Version 15.16.0
Models
claude

Add to Favorites

Why it matters

Develop, validate, and deploy AWS cloud infrastructure using the Cloud Development Kit with automated best-practice checks, integrated AWS documentation lookup, and construct recommendations to ensure secure, reusable, and production-ready infrastructure code.

Outcomes

What it gets done

01

Generate CDK stacks and constructs following AWS naming and reusability patterns

02

Validate infrastructure code with cdk-nag security and compliance rules before deployment

03

Look up latest AWS service capabilities and regional availability via MCP tools

04

Configure Lambda functions with automatic bundling for TypeScript, JavaScript, and Python

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-aws-cdk-development | bash

Overview

AWS CDK Development

This skill covers AWS CDK development best practices: resource naming conventions, runtime-specific Lambda constructs, three-layer cdk-nag validation, and MCP-verified AWS documentation throughout the development workflow. Use it when creating, refactoring, or validating CDK stacks and constructs, or verifying AWS service availability. Verify commands and generated code before applying changes.

What it does

This skill provides comprehensive guidance for developing AWS infrastructure with the CDK, integrated with MCP servers for live AWS documentation and CDK-specific guidance. It requires always verifying AWS facts via AWS documentation MCP tools before answering, auto-loading a setup dependency if those tools are unavailable, and notes that AWS Labs replaced the dedicated CDK MCP server with a broader aws-iac MCP server covering CDK, CloudFormation, and other infrastructure-as-code workflows. Core principles include never explicitly specifying optional resource names in CDK constructs, letting CDK generate unique CloudFormation-style names to enable reusable patterns, parallel deployments, and stack isolation, and using separate AWS accounts rather than resource naming for environment isolation between dev, staging, and production per AWS Security Pillar guidance. It also covers using the right Lambda construct per runtime - a Node.js-specific construct for TypeScript and JavaScript, a Python-specific one for Python - for automatic bundling and dependency management. A three-layer pre-deployment validation strategy runs real-time IDE feedback through cdk-nag's AWS Solutions checks aspect, required synthesis-time validation that runs automatically on synth with documented suppressions for legitimate exceptions, and a pre-commit safety net of build, tests, and a validation script checking language, template size and resource count, and synthesis success. The development workflow runs design, then verify AWS services for regional availability, quotas, and latest API specs via MCP, then implement using CDK MCP for construct recommendations, then validate, synthesize, review templates, deploy, and verify. Stack organization guidance covers nested stacks for complex applications, logical construct boundaries, exporting cross-stack values, and CDK context for environment configuration; testing strategy covers unit tests per construct, integration tests on synthesis, and CloudFormation template snapshot tests.

When to use - and when NOT to

Use it when creating new CDK stacks or constructs, refactoring existing CDK infrastructure, implementing Lambda functions within CDK, following CDK best practices, validating stack configurations before deployment, or verifying AWS service capabilities and regional availability. When GitHub Actions workflows exist in the repository, ensure all their checks pass before committing.

Inputs and outputs

Given an infrastructure requirement, it produces CDK constructs following documented naming, Lambda-construct, and validation conventions, plus synthesized and validated CloudFormation templates ready for review and deployment.

Integrations

AWS documentation MCP tools for verified AWS facts, the aws-iac MCP server for CDK and CloudFormation-specific guidance, cdk-nag for synthesis-time rule validation, and a bundled validation script plus a CDK patterns reference file covering patterns, anti-patterns, security, cost, and performance guidance.

Who it's for

AWS infrastructure developers building or maintaining CDK stacks who want current, MCP-verified AWS facts rather than stale training-data knowledge, plus a layered validation strategy across IDE, synthesis, and pre-commit stages before deploying real infrastructure changes.

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.