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

cloudformation-best-practices

하는 일

이 도구는 AWS 클라우드 인프라를 설정하는 코드(템플릿)를 만들고 검토하는 데 도움을 줍니다. 체계적이고 안전한 방식을 위한 모범 사례를 제안해, 코드가 잘 작동하고 문제를 피하도록 합니다.

사용하는 경우

  • ✓AWS 클라우드를 설정하는 새 코드를 작성할 때.
  • ✓기존 코드를 검토해 개선할 때.
  • ✓인프라를 더 작고 관리하기 쉬운 부분으로 나누고 싶을 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cloudformation-best-practices/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/cloudformation-best-practices/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 인프라 코드를 더 안전하고 관리하기 쉽게 만들려면 어떻게 해야 하나요?”

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

작동 방식

도구는 여러분의 코드를 분석하고 AWS 모범 사례에 따른 변경을 제안합니다. 구성, 보안, 흔한 오류 방지에 초점을 맞춥니다.

기술 내용 (원본 SKILL.md)

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

You are an expert in AWS CloudFormation specializing in template optimization, stack architecture, and production-grade infrastructure deployment.

Use this skill when

  • Writing or reviewing CloudFormation templates (YAML/JSON)
  • Optimizing existing templates for maintainability and cost
  • Designing nested or cross-stack architectures
  • Troubleshooting stack creation/update failures and drift

Do not use this skill when

  • The user prefers CDK or Terraform over raw CloudFormation
  • The task is application code, not infrastructure

Instructions

  1. Use YAML over JSON for readability.
  2. Parameterize environment-specific values; use Mappings for static lookups.
  3. Apply DeletionPolicy: Retain on stateful resources (RDS, S3, DynamoDB).
  4. Use Conditions to support multi-environment templates.
  5. Validate templates with aws cloudformation validate-template before deployment.
  6. Prefer !Sub over !Join for string interpolation.

Examples

Example 1: Parameterized VPC Template

AWSTemplateFormatVersion: "2010-09-09"
Description: Minimal VPC skeleton; subnet/routing/security resources are not included

Parameters:
  Environment:
    Type: String
    AllowedValues: [dev, staging, prod]
  VpcCidr:
    Type: String
    Default: "10.0.0.0/16"

Conditions:
  IsProd: !Equals [!Ref Environment, prod]

Resources:
  VPC:
    Type: AWS::EC2::VPC
    Properties:
      CidrBlock: !Ref VpcCidr
      EnableDnsSupport: true
      EnableDnsHostnames: true
      Tags:
        - Key: Name
          Value: !Sub "${Environment}-vpc"

Outputs:
  VpcId:
    Value: !Ref VPC
    Export:
      Name: !Sub "${Environment}-VpcId"

Best Practices

  • ✅ Do: Use Outputs with Export for cross-stack references
  • ✅ Do: Add DeletionPolicy and UpdateReplacePolicy on stateful resources
  • ✅ Do: Use cfn-lint and cfn-nag in CI pipelines
  • ❌ Don't: Hardcode ARNs or account IDs — use !Sub with pseudo parameters
  • ❌ Don't: Put all resources in a single monolithic template

Troubleshooting

Problem: Stack stuck in UPDATE_ROLLBACK_FAILED Solution: Inspect the exact stack events and failed-resource state first. Skipping resources is a last-resort recovery action requiring approval; skipped resources can remain inconsistent with the template and must be reconciled before another update.

Limitations

  • validate-template checks template form, not deployability, cost, policy or safe replacements. Review an explicit change set in the authorized account/region, especially deletes/replacements and IAM capabilities. DeletionPolicy alone does not protect replacement; evaluate UpdateReplacePolicy and backups.
  • Never execute a deploy/recovery or change a stack merely to validate these examples. The VPC skeleton does not provide production networking or public/private subnet isolation.
  • 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.
자주 묻는 질문

CloudFormation이란 무엇인가요?

AWS 도구로, 인프라를 코드로 설명하면 AWS가 자동으로 만들고 관리하도록 해 줍니다.

‘중첩 스택(nested stacks)’이란 무엇인가요?

큰 스크립트를 작고 재사용 가능한 스크립트로 나누는 것과 같습니다. 인프라를 더 잘 정리하고 관리하도록 돕습니다.

‘드리프트 감지’란 무엇인가요?

실제 클라우드 인프라가 여전히 코드에 적힌 내용과 일치하는지 확인하는 것입니다. 예상치 못한 차이를 찾아 고치는 데 도움을 줍니다.

상세 정보

작성자의 원본 설명

CloudFormation template optimization, nested stacks, drift detection, and production-ready patterns. Use when writing or reviewing CF templates.

repo: sickn33/agentic-awesome-skills

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬