terraform-skill
하는 일
이 스킬은 Terraform 또는 OpenTofu를 이용한 코드형 인프라 작업을 안내합니다. 코드로 클라우드 자원을 관리하는 개발자와 DevOps 엔지니어를 위한 스킬입니다.
사용하는 경우
- ✓새 Terraform 모듈을 만들거나 기존 설정을 다시 구성할 때.
- ✓인프라 코드에 대한 테스트나 CI/CD 파이프라인을 설정해야 할 때.
- ✓Terraform 상태 문제를 디버깅하거나 보안 관점에서 설정을 검토하는 경우.
스킬 링크
https://github.com/agentscope-ai/QwenPaw/blob/main/plugins/bundle/cloudpaw/skills/terraform-skill/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 Terraform 프로젝트의 보안 문제를 검토하고 모듈 구조를 제안해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 테스트 방법 선택, 모듈 구성, 파이프라인 설정, trivy와 checkov 같은 점검 도구 실행 방법을 설명합니다. 설정을 검토하거나 작성할 때 이 방법들을 적용합니다.
기술 내용 (원본 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.
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
Core Principles
1. Code Structure Philosophy
Module Hierarchy:
| Type | When to Use | Scope |
|---|---|---|
| Resource Module | Single logical group of connected resources | VPC + subnets, Security group + rules |
| Infrastructure Module | Collection of resource modules for a purpose | Multiple resource modules in one region/account |
| Composition | Complete infrastructure | Spans multiple regions/accounts |
Hierarchy: Resource → Resource Module → Infrastructure Module → Composition
Directory Structure:
environments/ # Environment-specific configurations
├── prod/
├── staging/
└── dev/
modules/ # Reusable modules
├── networking/
├── compute/
└── data/
examples/ # Module usage examples (also serve as tests)
├── complete/
└── minimal/
Key principle from terraform-best-practices.com:
- Separate environments (prod, staging) from modules (reusable components)
- Use examples/ as both documentation and integration test fixtures
- Keep modules small and focused (single responsibility)
For detailed module architecture, see: Code Patterns: Module Types & Hierarchy
2. Naming Conventions
Resources:
# Good: Descriptive, contextual
resource "aws_instance" "web_server" { }
resource "aws_s3_bucket" "application_logs" { }
# Good: "this" for singleton resources (only one of that type)
resource "aws_vpc" "this" { }
resource "aws_security_group" "this" { }
# Avoid: Generic names for non-singletons
resource "aws_instance" "main" { }
resource "aws_s3_bucket" "bucket" { }
Singleton Resources:
Use "this" when your module creates only one resource of that type:
✅ DO:
resource "aws_vpc" "this" {} # Module creates one VPC
resource "aws_security_group" "this" {} # Module creates one SG
❌ DON'T use "this" for multiple resources:
resource "aws_subnet" "this" {} # If creating multiple subnets
Use descriptive names when creating multiple resources of the same type.
Variables:
# Prefix with context when needed
var.vpc_cidr_block # Not just "cidr"
var.database_instance_class # Not just "instance_class"
Files:
main.tf- Primary resourcesvariables.tf- Input variablesoutputs.tf- Output valuesversions.tf- Provider versionsdata.tf- Data sources (optional)
Testing Strategy Framework
Decision Matrix: Which Testing Approach?
| Your Situation | Recommended Approach | Tools | Cost |
|---|---|---|---|
| Quick syntax check | Static analysis | terraform validate, fmt |
Free |
| Pre-commit validation | Static + lint | validate, tflint, trivy, checkov |
Free |
| Terraform 1.6+, simple logic | Native test framework | Built-in terraform test |
Free-Low |
| Pre-1.6, or Go expertise | Integration testing | Terratest | Low-Med |
| Security/compliance focus | Policy as code | OPA, Sentinel | Free |
| Cost-sensitive workflow | Mock providers (1.7+) | Native tests + mocking | Free |
| Multi-cloud, complex | Full integration | Terratest + real infra | Med-High |
Testing Pyramid for Infrastructure
/\
/ \ End-to-End Tests (Expensive)
/____\ - Full environment deployment
/ \ - Production-like setup
/________\
/ \ Integration Tests (Moderate)
/____________\ - Module testing in isolation
/ \ - Real resources in test account
/________________\ Static Analysis (C
자주 묻는 질문
Terraform 기본 문법을 가르치나요?
아닙니다. 기본 문법보다는 테스트, 모듈, CI/CD, 아키텍처 결정에 초점을 맞춥니다.
OpenTofu와도 작동하나요?
네. Terraform과 OpenTofu를 모두 다룹니다.
어떤 보안 도구를 언급하나요?
인프라 코드의 보안 문제를 검사하는 trivy와 checkov를 언급합니다.
상세 정보
작성자의 원본 설명
Use when working with Terraform or OpenTofu - creating modules, writing tests (native test framework, Terratest), setting up CI/CD pipelines, reviewing configurations, choosing between testing approaches, debugging state issues, implementing security scanning (trivy, checkov), or making infrastructure-as-code architecture decisions
repo: agentscope-ai/QwenPaw
인기도
- GitHub 스타
- 37k
- 순위
- #7569
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
computer_use
37k직접 쓸 수 있는 도구가 없을 때, 에이전트가 화면을 관찰하고 클릭하며 각 결과를 확인해 살아 있는 Windows 또는 macOS 앱을 조작하도록 돕습니다.
browser
37kQwenPaw Browser SDK로 에이전트가 실제 웹 브라우저를 조작해, 페이지를 읽고 행동하며 성공을 주장하기 전에 결과를 확인하도록 돕습니다.
channel_message
37k에이전트가 적절한 목적지를 찾은 뒤, 작업 완료 알림 같은 단방향 메시지를 특정 채팅 채널이나 세션에 보내도록 돕습니다.
chat_with_agent
37k에이전트가 다른 AI 에이전트에게 두 번째 의견, 계획, 검토를 구하고, 이전 맥락을 살려 그 대화를 이어가도록 돕습니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.