cdk-patterns
Construir Padrões de Infraestrutura AWS CDK
Projete infraestrutura AWS pronta para produção usando construtores CDK. Aplique padrões comprovados para APIs serverless, contêineres e pipelines de dados com construtores reutilizáveis de nível L2/L3.
Télécharger le ZIP du skill
Importer dans Claude
Allez dans Paramètres → Capacités → Skills → Importer un skill
Activez et commencez à utiliser
Tester
Utilisation de "cdk-patterns". Create a serverless API with Lambda and DynamoDB
Résultat attendu:
Generates a complete CDK construct with API Gateway integration, Lambda function with proper runtime configuration, DynamoDB table with on-demand billing, IAM permissions using grantReadWriteData, and X-Ray tracing enabled for observability.
Utilisation de "cdk-patterns". Review my CDK stack for best practices
Résultat attendu:
Provides specific recommendations: replace CfnFunction with lambda.Function L2 construct, add RemovalPolicy.RETAIN for stateful resources, implement least privilege IAM using table.grantReadWriteData instead of inline policies, and add cdk.Tags for resource organization.
Audit de sécurité
SûrAll static analysis findings are false positives. The 'Dynamic function constructor' at line 53 is actually a CDK Lambda construct (new lambda.Function). The 'Ruby/shell backtick execution' detections are markdown code block delimiters (```typescript), not shell commands. The 'Weak cryptographic algorithm' findings reference description text, not actual crypto code. This skill contains only documentation and example CDK TypeScript code with no executable security risks.
Score de qualité
Ce que vous pouvez construire
Desenvolvimento de API Serverless
Construa APIs serverless prontas para produção usando API Gateway, Lambda e DynamoDB com permissões IAM adequadas e monitoramento habilitado.
Construtores de Infraestrutura Reutilizáveis
Crie construtores L3 padronizados pela organização que codificam melhores práticas para implantações de infraestrutura consistentes entre equipes.
Revisão e Otimização de Código CDK
Revise código CDK existente para anti-padrões, problemas de segurança e oportunidades para usar construtores de nível superior.
Essayez ces prompts
Create a CDK stack in TypeScript that deploys a Lambda function with an S3 bucket. Use L2 constructs, apply removal policies, and enable X-Ray tracing.
Generate a reusable CDK construct for a serverless API with API Gateway, Lambda, and DynamoDB. Include proper IAM permissions, environment variables, and CloudWatch alarms.
Design a multi-stack CDK application separating stateful resources (RDS, S3) from stateless compute (Lambda, ECS). Show how to pass references between stacks.
Review this CDK stack for security anti-patterns, IAM over-permissions, and opportunities to use L2 constructs instead of L1. Suggest specific improvements.
Bonnes pratiques
- Use L2 constructs over L1 (Cfn*) constructs for safer defaults and less boilerplate code
- Separate stateful resources (databases, buckets) from stateless compute into different stacks for independent lifecycle management
- Apply the principle of least privilege to all IAM roles using grant methods instead of broad inline policies
Éviter
- Using L1 (Cfn*) constructs when L2 alternatives exist, resulting in more code and weaker safety guarantees
- Hardcoding account IDs or regions instead of using cdk.Aws.ACCOUNT_ID and cdk.Aws.REGION for portability
- Deploying stateful and stateless resources in the same stack, coupling their lifecycles unnecessarily