用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mikailustuner/OmniRule --skill terraform-basics命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Bun runtime: HTTP server, file I/O, SQLite, test runner, package manager, bundler — all-in-one JS toolchain.
Clerk: Drop-in auth UI, Organizations, User management, JWT templates, webhooks, Next.js middleware integration.
Gelişmiş masaüstü, tarayıcı ve işletim sistemi kontrol yeteneği. Görsel (koordinat tabanlı) fare/klavye otomasyonu, DOM manipülasyonu, pencere yönetimi, gelişmiş dosya, ağ ve süreç yönetimini kapsar.
基于 SOC 职业分类
正在显示 SKILL.md
| name | terraform-basics |
| description | Terraform: Infrastructure as code, state management, module patterns, CI/CD integration. |
| triggers | {"extensions":[".tf",".tfvars"],"keywords":["Terraform","IaC","infrastructure","AWS","resource","provider","module","state"]} |
| auto_load_when | Writing Terraform infrastructure code |
| agent | devops-engineer |
| tools | ["Read","Write","Bash"] |
Focus: IaC, state, modules, deployment
Terraform makes sense when:
├── Multi-cloud or hybrid
&& Same config for AWS/GCP/Azure
&& Migrate between providers
│
├── Complex infrastructure
&& Many resources with dependencies
&& Need to reproduce environments
│
├── Version control needed
&& Track infrastructure changes
&& Code review for infra
│
└── Automation required
&& CI/CD pipelines
&& Ephemeral environments
Don't use when:
├── Single cloud, simple setup
&& Console is faster
&& Low complexity
│
├── Dynamic/ephemeral only
&& Serverless-heavy
&& Too much drift
│
└── Team unfamiliar
&& Learning curve
&& Operational overhead
State management options:
├── Local (development only)
&& Simple, default
&& Don't share, don't version control
│
├── Remote (production)
&& S3, GCS, Terraform Cloud
&& Locking for concurrency
&& Encryption at rest
│
└── Backend config
&& Define in backend block
&& Use workspaces for environments
State best practices:
├── Never commit state to git
├── Use remote state in production
├── Enable state locking
├── Backup remote state
└── Handle sensitive data: use var, not in state
When to create modules:
├──重复使用资源
&& Same config in multiple places
&& Standard components
│
├──抽象复杂性
&& Hide implementation details
&& Expose simple interface
│
└──组织代码
└── Group related resources
└── Teams can own modules
Module structure:
├── Input variables: what configures
├── Outputs: what returns to parent
├── Resources: what creates
└── Variables: what references internally
CI/CD pipeline flow:
├── Lint: terraform fmt, validate
├── Plan: terraform plan, save output
├── Review: approve plan (manual/auto)
├── Apply: terraform apply
└── Destroy: for ephemeral environments
What to check in CI:
├── Formatting: terraform fmt
├── Validation: terraform validate
├── Security: tfsec, checkov
├── Cost: infracost (optional)
└── Plan review: don't just auto-approve
How to organize environments:
├── Workspace-based
&& dev, staging, prod workspaces
&& Same code, different state
&& Use workspace variable
│
├── Directory-based
&& environments/dev/, environments/prod/
&& Separate state files
&& More explicit, less magic
│
└── Git-branch-based
&& Feature branches = preview envs
&& Ephemeral, auto-destroy
&& Good for PR previews
❌ Storing tfstate locally — lost on laptop change, blocks team
✅ Remote state: S3 + DynamoDB lock, or Terraform Cloud
❌ Hardcoding secrets in .tf files
✅ Secrets via AWS Secrets Manager, Vault, or env vars
❌ Running terraform apply directly without plan review
✅ Always terraform plan → review → apply; automate in CI with approval gate
❌ One giant module for everything
✅ Split into reusable modules: networking, compute, database
❌ No lifecycle rules on resources that shouldn't be destroyed
✅ prevent_destroy = true on databases, S3 buckets with data
| Command | What it does | When |
|---|---|---|
| terraform init | Download providers | Before first apply |
| terraform plan | Show changes | Before every apply |
| terraform apply | Apply changes | After reviewing plan |
| terraform destroy | Remove all | Only in dev/staging |
| terraform import | Adopt existing resource | Brownfield migration |
| terraform state | Manipulate state | Advanced / emergency |