Przejdź do treści
Biblioteka skilli
DevOps i chmura · Budowanie i kod

cdk-patterns

/cdk-patterns

Opisuje typowe wzorce i konstrukty AWS CDK do budowy infrastruktury chmurowej w TypeScript, Python lub Java, przy projektowaniu wielokrotnego użytku stosów i konstruktów L3.

Repozytorium
lihongwei-cn ↗
Licencja
MIT
Ostatnia zmiana repozytorium
08.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 08.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Opisuje typowe wzorce i konstrukty AWS CDK do budowy infrastruktury chmurowej w TypeScript, Python lub Java, przy projektowaniu wielokrotnego użytku stosów i konstruktów L3.

Oryginalny opis (EN)

Common AWS CDK patterns and constructs for building cloud infrastructure with TypeScript, Python, or Java. Use when designing reusable CDK stacks and L3 constructs.

Jak działa

  1. Use this skill when
  2. Do not use this skill when
  3. Instructions
  4. Examples
  5. Best Practices
  6. Troubleshooting
  7. Limitations
Sekcje z nagłówków SKILL.md, w oryginale · 77 linii, 381 słów
Podgląd SKILL.md
---
name: cdk-patterns
description: "Common AWS CDK patterns and constructs for building cloud infrastructure with TypeScript, Python, or Java. Use when designing reusable CDK stacks and L3 constructs."
risk: unknown
source: community
date_added: "2026-02-27"
---
You are an expert in AWS Cloud Development Kit (CDK) specializing in reusable patterns, L2/L3 constructs, and production-grade infrastructure stacks.

## Use this skill when

- Building reusable CDK constructs or patterns
- Designing multi-stack CDK applications
- Implementing common infrastructure patterns (API + Lambda + DynamoDB, ECS services, static sites)
- Reviewing CDK code for best practices and anti-patterns

## Do not use this skill when

- The user needs raw CloudFormation templates without CDK
- The task is Terraform-specific
- Simple one-off CLI resource creation is sufficient

## Instructions

1. Identify the infrastructure pattern needed (e.g., serverless API, container service, data pipeline).
2. Use L2 constructs over L1 (Cfn*) constructs whenever possible for safer defaults.
3. Apply the principle of least privilege for all IAM roles and policies.
4. Use `RemovalPolicy` and `Tags` appropriately for production readiness.
5. Structure stacks for reusability: separate stateful (databases, buckets) from stateless (compute, APIs).
6. Enable monitoring by default (CloudWatch alarms, X-Ray tracing).

## Examples

### Example 1: Serverless API Pattern

```typescript
import { Construct } from "constructs";
import * as apigateway from "aws-cdk-lib/aws-apigateway";
import * as lambda from "aws-cdk-lib/aws-lambda";
import * as dynamodb from "aws-cdk-lib/aws-dynamodb";

export class ServerlessApiPattern extends Construct {
  constructor(scope: Construct, id: string) {
    super(scope, id);

    const table = new dynamodb.Table(this, "Table", {
      partitionKey: { name: "pk", type: dynamodb.AttributeType.STRING },
      billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
      removalPolicy: cdk.RemovalPolicy.RETAIN,
    });

    const handler = new lambda.Function(this, "Handler", {
      runtime: lambda.Runtime.NODEJS_20_X,
      handler: "index.handler",
      code: lambda.Code.fromAsset("lambda"),
      environment: { TABLE_NAME: table.tableName },
      tracing: lambda.Tracing.ACTIVE,
    });

    table.grantReadWriteData(handler);

    new apigateway.LambdaRestApi(this, "Api", { handler });
  }
}
```

## Best Practices

- ✅ **Do:** Use `cdk.Tags.of(this).add()` for consistent tagging
- ✅ **Do:** Separate stateful and stateless resources into different stacks
- ✅ **Do:** Use `cdk diff` before every deploy
- ❌ **Don't:** Use L1 (`Cfn*`) constructs when L2 alternatives exist
- ❌ **Don't:** Hardcode account IDs or regions — use `cdk.Aws.ACCOUNT_ID`

## Troubleshooting

**Problem:** Circular dependency between stacks
**Solution:** Extract shared resources into a dedicated base stack and pass references via constructor props.

## Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Wersje

RepozytoriumWynikLicencja
Ta strona · LiHongwei-cn/lihongwei-cn100MIT
FrancoStino/opencode-skills-collection100MIT
pinkpixel-dev/skills-collection-1100Apache-2.0

Migawka bazy z 13.11.2026 · wersja paczki 64d1f50d3eca (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100cdk-infrastructure-patterns
    Podaje wzorce AWS CDK w Pythonie dla stosów, konstruktów, tagowania, cdk-nag, CloudFront, Cognito i S3 przy pisaniu lub przeglądzie kodu infrastruktury.
  • 100aws-cdk
    Dostarcza wzorce AWS CDK w TypeScript do definiowania, walidacji i wdrażania infrastruktury jako kodu: aplikacje, stacki, konstrukty, domyślne IAM i szyfrowanie oraz przegląd cdk synth, diff i deploy.
  • 100aws-cdk-development
    Pomaga budować infrastrukturę chmurową w AWS CDK z TypeScriptem lub Pythonem: struktura aplikacji, wzorce konstruktów, kompozycja stacków, CloudFormation oraz workflow cdk synth i cdk deploy.
  • 100aws-cloudformation-cdk
    Definiuje infrastrukturę AWS w TypeScript lub Pythonie przez AWS CDK.
  • 100trove-cdk
    Stosuje konwencje AWS CDK w TypeScript przy pisaniu infrastruktury jako kodu w projekcie.
  • 90aws-cdk
    Pisze, wdraża i naprawia infrastrukturę AWS w CDK w TypeScript lub Pythonie, w tym import zasobów i wykrywanie driftu.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.