terraform-skill
Fungsinya
Skill ini memandu pekerjaan infrastruktur sebagai kode dengan Terraform atau OpenTofu. Skill ini untuk pengembang dan insinyur DevOps yang mengelola sumber daya cloud dengan kode.
Kapan dipakai
- βSaat Anda membuat modul Terraform baru atau menata ulang konfigurasi yang ada.
- βSaat Anda perlu menyiapkan tes atau pipeline CI/CD untuk kode infrastruktur.
- βSaat Anda men-debug masalah state Terraform atau meninjau konfigurasi untuk keamanan.
Link skill
https://github.com/agentscope-ai/QwenPaw/blob/main/plugins/bundle/cloudpaw/skills/terraform-skill/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βTinjau proyek Terraform saya untuk masalah keamanan dan sarankan struktur modul.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill ini menjelaskan cara memilih pendekatan pengujian, menyusun modul, menyiapkan pipeline, dan menjalankan alat pemindaian seperti trivy dan checkov. Skill ini menerapkan praktik tersebut saat meninjau atau menulis konfigurasi.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apakah skill ini mengajarkan sintaks dasar Terraform?
Tidak. Skill ini berfokus pada pengujian, modul, CI/CD, dan keputusan arsitektur, bukan sintaks dasar.
Apakah berfungsi dengan OpenTofu?
Ya. Skill ini mencakup Terraform dan OpenTofu.
Alat keamanan apa yang disebutkan?
Skill ini menyebut trivy dan checkov untuk memindai kode infrastruktur dari masalah keamanan.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 37k
- Peringkat
- #7569
- Lisensi
- Apache-2.0
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
computer_use
37kMemungkinkan agent Anda mengoperasikan aplikasi Windows atau macOS yang sedang berjalan dengan mengamati layar, mengklik, dan memeriksa setiap hasil, saat tidak ada alat langsung yang bisa menyelesaikan tugas.
browser
37kMemungkinkan agent Anda mengendalikan browser web sungguhan melalui QwenPaw Browser SDK, membaca halaman, bertindak di dalamnya, dan memeriksa hasil sebelum mengklaim berhasil.
channel_message
37kMemungkinkan agent Anda mengirim pesan satu arah ke saluran atau sesi chat tertentu, seperti peringatan bahwa tugas selesai, setelah menemukan tujuan yang tepat.
chat_with_agent
37kMemungkinkan agent Anda berkonsultasi dengan agent AI lain untuk pendapat kedua, rencana, atau tinjauan, lalu melanjutkan percakapan itu dengan konteks sebelumnya.
Skill serupa
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.