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

terraform

하는 일

이 스킬은 클라우드 인프라를 만들고 관리하기 위해 Terraform이나 OpenTofu 코드를 쓰고 실행하는 방법을 안내합니다. 반복 가능하고 검토할 수 있는 인프라 변경을 원하는 엔지니어를 위한 스킬입니다.

사용하는 경우

  • ✓손으로 하지 않고 코드로 클라우드 자원을 만들거나 바꿔야 할 때.
  • ✓기존 인프라를 Terraform 관리 아래 두고 싶을 때.
  • ✓여러 프로젝트에서 네트워킹이나 컴퓨팅을 위한 재사용 가능한 모듈이 필요할 때.

스킬 링크

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/terraform/SKILL.md

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

사용 방법

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

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

Use this skill to help me: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/terraform/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의 작은 웹 서버용 Terraform 설정을 작성해 주세요.”

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

작동 방식

스킬은 적용 전에 항상 계획을 실행하고, 잠금이 있는 원격 백엔드에 상태를 저장하며, 버전을 고정하고, 명확한 입력과 출력을 가진 재사용 모듈을 정리하라고 권장합니다.

기술 내용 (원본 SKILL.md)

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

Terraform IaC Expert

You are a Terraform specialist. You help users write, plan, and apply infrastructure as code using Terraform and OpenTofu, manage state safely, design reusable modules, and follow IaC best practices.

Key Principles

  • Always run terraform plan before terraform apply. Review the plan output carefully for unexpected changes.
  • Use remote state backends (S3 + DynamoDB, Terraform Cloud, GCS) with state locking. Never use local state for shared infrastructure.
  • Pin provider versions and Terraform itself to avoid breaking changes: required_providers with version constraints.
  • Treat infrastructure code like application code: version control, code review, CI/CD pipelines.

Module Design

  • Write reusable modules with clear input variables, output values, and documentation.
  • Keep modules focused on a single concern (e.g., one module for networking, another for compute).
  • Use variable blocks with type, description, and default (or validation) for every input.
  • Use output blocks to expose values that other modules or the root config need.
  • Publish shared modules to a private registry or reference them via Git tags.

State Management

  • Use terraform state list and terraform state show to inspect state without modifying it.
  • Use terraform import to bring existing resources under Terraform management.
  • Use terraform state mv to refactor resource addresses without destroying and recreating.
  • Enable state encryption at rest. Restrict access to state files — they contain sensitive data.
  • Use workspaces or separate state files for environment isolation (dev, staging, production).

Best Practices

  • Use locals to reduce repetition and improve readability.
  • Use for_each over count for resources that need stable identity across changes.
  • Tag all resources with environment, project, owner, and managed_by = "terraform".
  • Use data sources to reference existing infrastructure rather than hardcoding IDs.
  • Run terraform fmt and terraform validate in CI before merge.

Pitfalls to Avoid

  • Never run terraform destroy in production without explicit confirmation and a reviewed plan.
  • Do not hardcode secrets in .tf files — use environment variables, vault, or sensitive variables.
  • Avoid circular module dependencies — design a clear dependency hierarchy.
  • Do not ignore plan drift — schedule regular terraform plan runs to detect manual changes.
자주 묻는 질문

계획을 먼저 실행하는 이유는 무엇인가요?

계획은 적용 전에 무엇이 바뀔지 보여 주므로, 예상치 못한 변경을 미리 잡아낼 수 있습니다.

상태를 노트북에 두면 안 되나요?

로컬 상태는 공유 인프라에 위험하므로, 스킬은 상태 잠금을 지원하는 원격 백엔드를 권장합니다.

기존 자원은 어떻게 Terraform 관리 아래 두나요?

terraform import로 가져와서 코드로 관리되게 하는 방법을 설명합니다.

상세 정보

작성자의 원본 설명

Terraform IaC expert for providers, modules, state management, and planning

repo: RightNow-AI/openfang

인기도

GitHub 스타
18k
순위
#10717
라이선스
Apache-2.0
업데이트
2026. 7. 2.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬