본문으로 건너뛰기
cccskills
무료GitHub에 공개

terraform-infra

Terraform infrastructure operations with safety controls

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구AWSAzureTerraform
설치 방법 보기

포함된 파일(10)

  • SKILL.md8.5 KB
  • commands/terraform-infra.md115 B
  • hooks/post-execute.cjs870 B
  • hooks/pre-execute.cjs871 B
  • references/research-requirements.md337 B
  • rules/terraform-infra.md274 B
  • schemas/input.schema.json267 B
  • schemas/output.schema.json628 B
  • scripts/main.cjs1.6 KB
  • templates/implementation-template.md189 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Terraform Infrastructure Skill

Installation

The skill invokes the Terraform CLI. Install:

  • macOS: brew tap hashicorp/tap && brew install hashicorp/tap/terraform
  • Windows: choco install terraform or download from HashiCorp
  • Linux (apt): Add HashiCorp repo then sudo apt update && sudo apt install terraform (see HashiCorp install)

Verify: terraform --version

Cheat Sheet & Best Practices

Workflow: terraform init → terraform fmt → terraform validate → terraform plan -out=tfplan → review → terraform apply tfplan. Use terraform show tfplan to inspect.

Hacks: Always run plan before apply; never apply blind. Use remote state (e.g. S3 + lock) for team work. Prefer -auto-approve only in CI with reviewed plans. Use terraform state list and terraform state show <resource> to debug. Use service accounts / workload identity in pipelines; avoid static keys.

Certifications & Training

HashiCorp Terraform Associate (004): IaC concepts, Terraform fundamentals, state, modules, Terraform Cloud. Learning path. Skill data: init → fmt → validate → plan -out → apply; remote state; no blind apply.

Hooks & Workflows

Suggested hooks: Pre-apply: run terraform plan -out=tfplan and gate on review. CI: apply only after plan approval. Use with devops (primary).

Workflows: Use with devops (primary). Flow: init → plan → review → apply; use state commands for debugging. See ci-cd-implementation-rule for pipeline integration.

Overview

Provides 90%+ context savings vs raw Terraform MCP server. Includes critical safety controls for infrastructure operations.

Requirements

  • Terraform CLI (v1.0+)
  • Cloud provider credentials configured
  • Working directory with .tf files

Tools (Progressive Disclosure)

Planning & Validation

ToolDescriptionConfirmation
planGenerate terraform planNo
validateValidate configurationNo
fmtFormat terraform filesNo

State Operations

ToolDescriptionConfirmation
showDisplay current stateNo
listList state resourcesNo
state-mvMove resource in stateYes

Workspace Operations

ToolDescriptionConfirmation
workspace-listList workspacesNo
workspace-selectSelect workspaceNo
workspace-newCreate workspaceYes

Execution (⚠️ Dangerous)

ToolDescriptionConfirmation
applyApply changesREQUIRED

Blocked Operations

ToolStatus
destroyBLOCKED
state-rmBLOCKED

Quick Reference

# Initialize
terraform init

# Plan changes
terraform plan -out=tfplan

# Validate
terraform validate

# Apply (requires -auto-approve for automation)
terraform apply tfplan

Configuration

  • Working directory: Must contain terraform files
  • TFVAR*: Variable values via environment
  • TF_WORKSPACE: Active workspace

Safety Controls

⚠️ terraform apply ALWAYS requires confirmation ⚠️ terraform destroy is BLOCKED by default ⚠️ State modifications require confirmation ⚠️ Review plan output before apply

Agent Integration

  • devops (primary): Infrastructure management
  • architect (secondary): Infrastructure design
  • cloud-integrator (secondary): Cloud provisioning

Troubleshooting

IssueSolution
Init failedCheck provider credentials
State lockedCheck for other operations
Plan failedReview error output carefully

Module Development

Creating Reusable Modules

Structure modules following HashiCorp conventions:

modules/
  vpc/
    main.tf          # Resource definitions
    variables.tf     # Input variables
    outputs.tf       # Output values
    versions.tf      # Required provider versions
    README.md        # Module documentation

Module Best Practices

PracticeDescription
Single responsibilityEach module manages one logical resource group
Typed variablesUse type constraints on all variables
Validation blocksAdd validation {} for input constraints
Sensitive outputsMark secrets with sensitive = true
Version constraintsPin module source versions

Module Source Patterns

# Local module
module "vpc" {
  source = "./modules/vpc"
}

# Terraform Registry
module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "~> 5.0"
}

# Git source (pinned tag)
module "vpc" {
  source = "git::https://github.com/org/modules.git//vpc?ref=v1.2.0"
}

Provider Development Patterns

Custom Provider Skeleton

package provider

import (
    "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

func Provider() *schema.Provider {
    return &schema.Provider{
        Schema: map[string]*schema.Schema{
            "api_key": {
                Type:        schema.TypeString,
                Required:    true,
                Sensitive:   true,
                DefaultFunc: schema.EnvDefaultFunc("API_KEY", nil),
            },
        },
        ResourcesMap: map[string]*schema.Resource{
            "myservice_resource": resourceMyServiceResource(),
        },
    }
}

Testing Modules

# Validate module syntax
cd modules/vpc && terraform validate

# Run module tests (Terraform 1.6+)
terraform test

# Plan with module
terraform plan -var-file=examples/basic.tfvars

Iron Laws

  1. ALWAYS run terraform plan and review the output before executing terraform apply
  2. NEVER hardcode credentials or secrets in .tf files — use secret managers (AWS Secrets Manager, Azure Key Vault, HashiCorp Vault)
  3. ALWAYS use remote state with encryption and state locking to prevent concurrent modifications
  4. NEVER edit state files directly — use terraform state commands exclusively
  5. ALWAYS pin provider and module versions for fully reproducible infrastructure deployments

Anti-Patterns

Anti-PatternWhy It FailsCorrect Approach
Hardcoded credentials in .tf filesSecret exposure in VCS, compliance failureUse variables with secret manager backend
No state lockingConcurrent applies corrupt stateEnable backend locking (S3+DynamoDB, Azure Blob, GCS)
terraform apply without plan reviewUnexpected resource deletion or recreationAlways plan first, review diff, then apply
Unversioned providers and modulesNon-reproducible builds and breaking changesPin versions: version = "~> 4.0"
Untagged resourcesUntrackable costs and compliance failureTag all resources with env, owner, cost-center

Memory Protocol (MANDATORY)

Before starting: Read .claude/context/memory/learnings.md

After completing:

  • New pattern -> .claude/context/memory/learnings.md
  • Issue found -> .claude/context/memory/issues.md
  • Decision made -> .claude/context/memory/decisions.md

ASSUME INTERRUPTION: If it's not in memory, it didn't happen.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Ensure accessibility in UI components including semantic HTML, ARIA attributes, keyboard navigation, and WCAG 2.2 AA compliance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio432026년 7월 14일 업데이트

Use when you want to improve response quality through meta-cognitive reasoning. Applies 15+ reasoning methods to reconsider and refine initial outputs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio432026년 7월 14일 업데이트

N-round opposing-stance debates for trade-off analysis. Assigns pro/con roles to agents, runs structured debate rounds with quality scoring, and produces a moderator synthesis with confidence-rated recommendation. Generalizable to architecture, technology, security, and design decisions.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio432026년 7월 14일 업데이트

Force adversarial code review stance that eliminates confirmation bias — reviewer must find issues or re-analyze

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio432026년 7월 14일 업데이트

Creates specialized AI agents on-demand when no existing agent matches a request. Use when the Router cannot find a suitable agent for a task. Enables self-evolution by generating persistent agents.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio432026년 7월 14일 업데이트

LLM-as-judge evaluation framework with 5-dimension rubric (accuracy, groundedness, coherence, completeness, helpfulness) for scoring AI-generated content quality with weighted composite scores and evidence citations

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio432026년 7월 14일 업데이트

oimiragieo의 스킬 모두 보기

이 스킬의 문제 신고