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

terraform-patterns

하는 일

이 스킬은 파일로 클라우드 인프라를 정의하는 Terraform 코드를 작성하고 검토하도록 돕습니다. 인프라를 관리하며 더 안전하고 깔끔한 설정을 원하는 엔지니어에게 맞습니다.

사용하는 경우

  • ✓구조가 잘못되었거나 실수가 있는지 Terraform 파일을 검토할 때.
  • ✓재사용 가능한 Terraform 모듈을 설계할 때.
  • ✓변경하기 전에 인프라 코드의 보안 검토가 필요할 때.

스킬 링크

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/terraform-patterns/skills/terraform-patterns/SKILL.md

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

사용 방법

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

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

Use this skill to help me: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/terraform-patterns/skills/terraform-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에게 요청하는 예시

“Terraform 파일을 적용하기 전에 보안 문제와 나쁜 패턴이 있는지 검토해 주세요.”

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

작동 방식

스킬은 모듈 구조를 분석하고, 설정을 스캔해서 잘못된 설정과 노출된 비밀 정보를 찾은 뒤 수정안을 제안합니다.

기술 내용 (원본 SKILL.md)

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

Terraform Patterns

Predictable infrastructure. Secure state. Modules that compose. No drift.

Opinionated Terraform workflow that turns sprawling HCL into well-structured, secure, production-grade infrastructure code. Covers module design, state management, provider patterns, security hardening, and CI/CD integration.

Not a Terraform tutorial — a set of concrete decisions about how to write infrastructure code that doesn't break at 3 AM.


Slash Commands

Command What it does
/terraform-patterns review Analyze Terraform code for anti-patterns, security issues, and structure problems
/terraform-patterns module Design or refactor a Terraform module with proper inputs, outputs, and composition
/terraform-patterns security Audit Terraform code for security vulnerabilities, secrets exposure, and IAM misconfigurations

When This Skill Activates

Recognize these patterns from the user:

  • "Review this Terraform code"
  • "Design a Terraform module for..."
  • "My Terraform state is..."
  • "Set up remote state backend"
  • "Multi-region Terraform deployment"
  • "Terraform security review"
  • "Module structure best practices"
  • "Terraform CI/CD pipeline"
  • Any request involving: .tf files, HCL, Terraform modules, state management, provider configuration, infrastructure-as-code

If the user has .tf files or wants to provision infrastructure with Terraform → this skill applies.


Workflow

/terraform-patterns review — Terraform Code Review

  1. Analyze current state

    • Read all .tf files in the target directory
    • Identify module structure (flat vs nested)
    • Count resources, data sources, variables, outputs
    • Check naming conventions
  2. Apply review checklist

    MODULE STRUCTURE
    ├── Variables have descriptions and type constraints
    ├── Outputs expose only what consumers need
    ├── Resources use consistent naming: {provider}_{type}_{purpose}
    ├── Locals used for computed values and DRY expressions
    └── No hardcoded values — everything parameterized or in locals
    
    STATE & BACKEND
    ├── Remote backend configured (S3, GCS, Azure Blob, Terraform Cloud)
    ├── State locking enabled (DynamoDB for S3, native for others)
    ├── State encryption at rest enabled
    ├── No secrets stored in state (or state access is restricted)
    └── Workspaces or directory isolation for environments
    
    PROVIDERS
    ├── Version constraints use pessimistic operator: ~> 5.0
    ├── Required providers block in terraform {} block
    ├── Provider aliases for multi-region or multi-account
    └── No provider configuration in child modules
    
    SECURITY
    ├── No hardcoded secrets, keys, or passwords
    ├── IAM follows least-privilege principle
    ├── Encryption enabled for storage, databases, secrets
    ├── Security groups are not overly permissive (no 0.0.0.0/0 ingress on sensitive ports)
    └── Sensitive variables marked with sensitive = true
    
  3. Generate report

    python3 scripts/tf_module_analyzer.py ./terraform
    
  4. Run security scan

    python3 scripts/tf_security_scanner.py ./terraform
    

/terraform-patterns module — Module Design

  1. Identify module scope

    • Single responsibility: one module = one logical grouping
    • Determine inputs (variables), outputs, and resource boundaries
    • Decide: flat module (single directory) vs nested (calling child modules)
  2. Apply module design checklist

    STRUCTURE
    ├── main.tf        — Primary resources
    ├── variables.tf   — All input variables with descriptions and types
    ├── outputs.tf     — All outputs with descriptions
    ├── versions.tf    — terraform {} block with required_providers
    ├── locals.tf      — Computed values and naming conventions
    ├── data.tf        — Data sources (if any)
    └── README.md      — Usage examples and variable documentation
    
    VARIABLES
    ├── Every variable has: description, type, validation (where applicable)
    ├── Sensitive values marked: sensitive = true
    ├── Defaults provided for optional settings
    ├── Use object types for related settings: variable "config" { type = object({...}) }
    └── Validate with: validation { condition = ... }
    
    OUTPUTS
    ├── Output IDs, ARNs, endpoints — things consumers need
    ├── Include description on every output
    ├── Mark sensitive outputs: sensitive = true
    └── Don't output entire resources — only specific attributes
    
    COMPOSITI
    
자주 묻는 질문

원격 상태 저장도 다루나요?

네. 원격 상태 백엔드 설정이 포함됩니다.

terraform apply도 대신 실행하나요?

아니요. 검토하고 변경을 제안할 뿐이며, 배포 단계는 여러분이 직접 실행합니다.

어떤 클라우드를 다루나요?

공급자 설정, IAM, 여러 리전 구성 등 일반적인 Terraform 패턴을 다룹니다.

상세 정보

작성자의 원본 설명

Use for any Terraform module, state backend, provider setup or IaC security review, before editing .tf files. Analyzes modules with tf_module_analyzer.py and scans for misconfigurations with tf_security_scanner.py.

repo: alirezarezvani/claude-skills

인기도

GitHub 스타
29k
순위
#9612
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬