본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)48k · #4119

cdk-patterns

하는 일

이 도구는 AWS CDK를 사용해 클라우드 인프라를 위한 재사용 가능한 구성 블록을 만드는 데 도움을 줍니다. 클라우드 애플리케이션을 더 효율적이고 안전하게 만드는 일반적인 패턴을 제공합니다.

사용하는 경우

  • ✓여러 번 사용될 인프라 구성 요소를 만들 때.
  • ✓여러 부분이 서로 연결된 복잡한 애플리케이션을 설계할 때.
  • ✓API, 컨테이너 서비스, 정적 웹사이트 같은 일반 패턴을 구현할 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cdk-patterns/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cdk-patterns/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“AWS CDK를 사용해 DynamoDB 데이터베이스를 쓰는 서버리스 API의 패턴을 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 고수준 AWS CDK ‘구성 블록(constructs)’을 사용해 인프라 리소스를 정의합니다. 보안, 체계, 모니터링에 대한 모범 사례를 자동으로 적용합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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

import { Construct } from "constructs";
import * as cdk from "aws-cdk-lib";
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 });
  }
}

The lambda/ asset directory must contain the project's actual handler before synthesis. The snippet is a construct illustration, not a deployable complete application: review API authorization, input validation, logging, cost, account/region, and IAM scope first. Run project tests, cdk synth, and inspect cdk diff; deployment requires authorization for the named environment. An L2 construct alone does not establish safe defaults.

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.
자주 묻는 질문

AWS CDK란 무엇인가요?

AWS CDK(Cloud Development Kit)는 TypeScript, Python, Java 같은 익숙한 프로그래밍 언어로 클라우드 인프라를 정의할 수 있게 해 주는 도구입니다.

‘구성 블록’이란 무엇인가요?

인프라의 구성 요소를 나타내는 블록입니다. 여러 수준이 있으며, 이 도구는 가장 재사용하기 쉽고 안전한 블록에 집중합니다.

왜 패턴을 사용하나요?

패턴을 쓰면 인프라를 일관되고 안전하게 만들 수 있고, 권장되는 모범 사례를 따르므로 관리하기도 쉽습니다.

상세 정보

작성자의 원본 설명

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

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4119
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬