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

terraform-skill

하는 일

이 도구는 서버와 데이터베이스 같은 기술 인프라를 자동으로, 안전하게 관리하는 코드를 작성하고 정리하도록 돕습니다. Terraform과 OpenTofu 같은 도구의 모범 사례를 제공합니다.

사용하는 경우

  • ✓인프라를 관리하기 위한 새 구성을 만들 때.
  • ✓인프라 코드에 대한 테스트를 설정할 때.
  • ✓여러 환경이나 지속적 통합(CI)을 위해 코드를 어떻게 구조화할지 정할 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/terraform-skill/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/terraform-skill/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 Skill for Claude

Comprehensive Terraform and OpenTofu guidance covering testing, modules, CI/CD, and production patterns. Based on terraform-best-practices.com and enterprise experience.

Detailed Guide

Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.

When to Use This Skill

Activate this skill when:

  • Creating new Terraform or OpenTofu configurations or modules
  • Setting up testing infrastructure for IaC code
  • Deciding between testing approaches (validate, plan, frameworks)
  • Structuring multi-environment deployments
  • Implementing CI/CD for infrastructure-as-code
  • Reviewing or refactoring existing Terraform/OpenTofu projects
  • Choosing between module patterns or state management approaches

Don't use this skill for:

  • Basic Terraform/OpenTofu syntax questions (Claude knows this)
  • Provider-specific API reference (link to docs instead)
  • Cloud platform questions unrelated to Terraform/OpenTofu

Count vs For_Each: When to Use Each

Quick Decision Guide

Scenario Use Why
Boolean condition (create or don't) count = condition ? 1 : 0 Simple on/off toggle
Simple numeric replication count = 3 Fixed number of identical resources
Items may be reordered/removed for_each = toset(list) Stable resource addresses
Reference by key for_each = map Named access to resources
Multiple named resources for_each Better maintainability

Common Patterns

Boolean conditions:

# ✅ GOOD - Boolean condition
resource "aws_nat_gateway" "this" {
  count = var.create_nat_gateway ? 1 : 0
  # ...
}

Stable addressing with for_each:

# ✅ GOOD - Removing "us-east-1b" only affects that subnet
resource "aws_subnet" "private" {
  for_each = toset(var.availability_zones)

  availability_zone = each.key
  # ...
}

# ❌ BAD - Removing middle AZ recreates all subsequent subnets
resource "aws_subnet" "private" {
  count = length(var.availability_zones)

  availability_zone = var.availability_zones[count.index]
  # ...
}

For migration guides and detailed examples, see: Code Patterns: Count vs For_Each

Security & Compliance

Essential Security Checks

# Static security scanning
trivy config .
checkov -d .

Common Issues to Avoid

❌ Don't:

  • Store secrets in variables
  • Use default VPC
  • Skip encryption
  • Open security groups to 0.0.0.0/0

✅ Do:

  • Use AWS Secrets Manager / Parameter Store
  • Create dedicated VPCs
  • Enable encryption at rest
  • Use least-privilege security groups

For detailed security guidance, see:

  • Security & Compliance Guide - Trivy/Checkov integration, secrets management, state file security, compliance testing

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

'코드로서의 인프라(IaC)'란 무엇인가요?

수동으로 설정하는 대신 코드를 작성해 IT 인프라를 정의하고 관리하는 것입니다. 과정을 반복 가능하고, 버전 관리가 가능하며, 더 신뢰할 수 있게 만듭니다.

Terraform에서 'count'와 'for_each'의 차이는 무엇인가요?

'count'는 고정된 개수의 동일한 리소스를 만들 때 쓰고, 'for_each'는 목록이나 맵을 기반으로 리소스를 만들 수 있어 더 유연합니다. 항목이 추가되거나 제거될 때 관리가 쉬워집니다.

인프라를 테스트하는 것이 왜 중요한가요?

테스트는 인프라가 기대대로 작동하는지 확인하고, 운영 환경의 오류를 막으며, 보안 설정이 적용되기 전에 올바른지 검증합니다.

상세 정보

작성자의 원본 설명

Terraform infrastructure as code best practices

repo: sickn33/agentic-awesome-skills

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬