Token导航 LogoToken导航TokenDH.com
运维和基础设施external-servicegithub未标认证来源可访问clear审计通过

terraform-engineerTerraform 工程师

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

2,739

周安装

113

GitHub Stars

76

下载量

895
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:terraform-engineer(Terraform 工程师)
来源仓库:https://github.com/404kidwiz/claude-supercode-skills
仓库路径:skills/terraform-engineer
安装命令:
npx skills add https://github.com/404kidwiz/claude-supercode-skills --skill terraform-engineer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/404kidwiz/claude-supercode-skills --skill terraform-engineer

简介

terraform-engineer 专注于基础设施即代码(IaC),擅长使用 Terraform 设计云资源模块和自动化部署流程。

  • 适用于新建 VPC、EKS、RDS 等云资源,重构单体配置为可复用模块,并实现 GitOps 驱动的基础设施管理。
  • 在 Codex、Claude、Cursor 或 Gemini CLI 中辅助检查配置、生成部署步骤或分析资源状态。
  • 安装方式:通过 npx 从 GitHub 仓库添加,需明确目标环境、账号权限和资源组后再操作。
  • 注意:涉及删除、重启或网络变更时,应评估影响范围;生产环境操作前建议本地测试。

SKILL.md

Terraform Engineer

Purpose

Provides Infrastructure as Code expertise specializing in Terraform and OpenTofu for cloud provisioning. Designs modular, scalable infrastructure with proper state management, remote backends, and GitOps-driven automation pipelines.

When to Use

  • Provisioning new cloud infrastructure (VPCs, EKS, RDS)
  • Refactoring monolithic Terraform code into reusable modules
  • Implementing "GitOps" for infrastructure (Atlantis/TFC)
  • Managing remote state, locking, and backend configuration
  • Writing custom providers or complex HCL logic (loops, conditionals)
  • Migrating/importing existing manual infrastructure into Terraform

Examples

Example 1: Multi-Cloud Landing Zone

Scenario: Building a secure, compliant multi-cloud landing zone.

Implementation:

  1. Created reusable modules for VPC, IAM, security groups
  2. Implemented remote state with S3 backend and DynamoDB locking
  3. Added variable validation and preconditions
  4. Implemented cost estimation and budget alerts
  5. Set up Terraform Cloud for state management

Results:

  • Infrastructure provisioning reduced from weeks to hours
  • 100% consistency across environments
  • Security compliance automated
  • 40% reduction in cloud costs through optimization

Example 2: Kubernetes Platform with EKS

Scenario: Building a production-ready Kubernetes platform.

Implementation:

  1. Created EKS module with managed node groups
  2. Implemented RBAC and service accounts
  3. Added network policies and security groups
  4. Configured secrets management with Vault integration
  5. Set up monitoring and observability

Results:

  • Platform deployment in under 30 minutes
  • Zero configuration drift
  • Built-in security controls
  • Clear upgrade path for K8s versions

Example 3: Legacy Infrastructure Migration

Scenario: Importing manually provisioned infrastructure into Terraform.

Implementation:

  1. Used terraform import for existing resources
  2. Created corresponding Terraform configurations
  3. Implemented state mv for resource reorganization
  4. Verified no changes during import
  5. Established Terraform as source of truth

Results:

  • 200+ resources migrated to Terraform
  • Infrastructure now version controlled
  • Enables infrastructure as code workflows
  • Improved audit and compliance

Best Practices

State Management

  • Remote Backend: Always use remote state (S3, GCS, Terraform Cloud)
  • State Locking: Prevent concurrent modifications
  • State Isolation: Separate state for environments
  • Backup: Enable state versioning

Module Development

  • Single Responsibility: Each module does one thing well
  • Version Pinning: Lock module versions
  • Documentation: Document inputs, outputs, behavior
  • Testing: Test modules before publishing

Code Quality

  • Formatting: Use terraform fmt consistently
  • Validation: Run terraform validate
  • Linting: Use tflint for provider-specific issues
  • Security Scanning: Use tfsec/checkov

Collaboration

  • Code Review: All changes reviewed before merge
  • Workspace Strategy: Use workspaces for environment isolation
  • Variable Management: Use variable files, not hardcoding
  • Output Documentation: Document important outputs


2. Decision Framework

State Management Strategy

ScaleStrategyBackend
IndividualLocal Statelocal (Not recommended for prod)
Small TeamRemote State + Lockings3 + DynamoDB (AWS) / azurerm (Azure)
EnterpriseManaged State + RunsTerraform Cloud / spacelift / env0
GitOpsPR-driven RunsAtlantis (Self-hosted)

Module Architecture

What are you building?
│
├─ **Root Module** (The "Glue")
│  ├─ `main.tf`: Instantiates child modules
│  ├─ `providers.tf`: Provider config
│  └─ `backend.tf`: State config
│
├─ **Child Modules** (Reusable)
│  ├─ **Resource Modules**: Wraps single resource (e.g., `s3-secure-bucket`)
│  │  └─ Enforces tagging, encryption, logging defaults.
│  │
│  └─ **Infrastructure Modules**: Logical group (e.g., `vpc-with-peering`)
│     └─ Combines VPC, Subnets, Route Tables, NAT Gateways.
│
└─ **Composition** (Terragrunt/Workspaces)
   ├─ `prod/`
   ├─ `stage/`
   └─ `dev/`

Terraform vs. The World

ToolApproachBest For
TerraformHCL (Declarative)Industry standard, massive ecosystem.
PulumiGeneral Purpose Lang (TS/Py)Devs who hate HCL, dynamic logic.
CrossplaneK8s Custom ResourcesControl planes, self-service platforms.
CloudFormationYAML/JSONAWS purists (drift detection is native).

Red Flags → Escalate to security-engineer:

  • Hardcoded AWS keys in provider block
  • State files stored in git (terraform.tfstate)
  • Security Groups allowing 0.0.0.0/0 on SSH/RDP
  • S3 buckets public by default


3. Core Workflows

Workflow 1: Production AWS VPC (Modular)

Goal: Create a 3-tier VPC network using the community module.

Steps:

  1. Dependency Definition (versions.tf) terraform {required_version = ">= 1.5.0" required_providers {aws = {source = "hashicorp/aws" version = "~> 5.0"}}}
  2. Implementation (main.tf) module "vpc" {source = "terraform-aws-modules/vpc/aws" version = "5.5.1" name = "prod-vpc" cidr = "10.0.0.0/16" azs = ["us-east-1a", "us-east-1b", "us-east-1c"] private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"] enable_nat_gateway = true single_nat_gateway = false # High Availability enable_vpn_gateway = false tags = {Environment = "Production" Terraform = "true"}}
  3. Outputs (outputs.tf) output "vpc_id" {description = "The ID of the VPC" value = module.vpc.vpc_id}


Workflow 3: Importing Existing Infrastructure

Goal: Bring a manually created EC2 instance under Terraform control.

Steps:

  1. Identify Resource ID

- AWS Console → EC2 → Instance ID: i-0123456789abcdef0

  1. Write Terraform Code resource "aws_instance" "legacy_server" {ami = "ami-0c55b159cbfafe1f0" instance_type = "t2.micro" # Fill in other known details...}
  2. Run Import terraform import aws_instance.legacy_server i-0123456789abcdef0 *(Or use import block in TF 1.5+)* import {to = aws_instance.legacy_server id = "i-0123456789abcdef0"}
  3. Reconcile

- Run terraform plan. - Update code to match the state until "No changes" is reported.



5. Anti-Patterns & Gotchas

❌ Anti-Pattern 1: Monolithic State File

What it looks like:

  • One main.tf controlling VPC, Database, EKS, and 50 Microservices.
  • terraform plan takes 10 minutes.

Why it fails:

  • Blast Radius: One error breaks everything.
  • Performance: API rate limits (AWS Throttling).
  • Locking: Dev A blocks Dev B.

Correct approach:

  • Split State: Separate network, data, app-cluster.
  • Use terraform_remote_state data source to read outputs from other layers.

❌ Anti-Pattern 2: Hardcoding Environments

What it looks like:

  • vpc-prod.tf, vpc-dev.tf files with duplicated code.

Why it fails:

  • Drift between environments.
  • Double maintenance.

Correct approach:

  • Workspaces: Use terraform workspace with var.environment.
  • Tfvars: prod.tfvars vs dev.tfvars.
  • Modules: Reuse the same logic, pass different variables.

❌ Anti-Pattern 3: Ignoring .gitignore

What it looks like:

  • Committing .terraform/ directory (plugins).
  • Committing terraform.tfvars (secrets).

Why it fails:

  • Repo bloat.
  • Security leak.

Correct approach:

  • Standard .gitignore for Terraform: .terraform/ *.tfstate *.tfstate.backup *.tfvars.terraform.lock.hcl (Commit this one!)


7. Quality Checklist

Code Quality:

  • Formatting: Run terraform fmt -recursive.
  • Validation: Run terraform validate.
  • Linting: Run tflint for provider-specific issues.
  • Docs: Generate README using terraform-docs.

Security:

  • Secrets: No plain text secrets (Use KMS/Vault/Secrets Manager).
  • Encryption: encrypted = true on all storage (EBS, S3, RDS).
  • Public Access: Locked down (S3 Block Public Access).

Reliability:

  • State: Remote backend configured with locking.
  • Versions: Provider and Terraform versions pinned (e.g., ~> 5.0).
  • Cleanup: destroy provisioners tested (or protection enabled for DBs).

Anti-Patterns

State Management Anti-Patterns

  • Local State: Using local state files - always use remote backends
  • State Drift: Manual changes outside Terraform - use only Terraform for changes
  • State Lock Contention: No state locking - implement proper locking
  • State Corruption: Editing state files manually - never manually edit state

Module Anti-Patterns

  • Monolithic Modules: Large, unwieldy modules - split into focused modules
  • Hardcoded Values: Using values instead of variables - parameterize everything
  • Module Version Chaos: No version pinning - pin module versions
  • Deep Module Nesting: Over-nested module structures - keep module hierarchy flat

Resource Anti-Patterns

  • Resource Spam: Many small resources instead of patterns - use resource grouping
  • Lifecycle Lock: Resources that can't update - avoid create_before_destroy conflicts
  • Ignored Changes: Overusing ignore_changes - understand and manage changes
  • Sensitive Data Exposure: Plain text secrets in state - use sensitive flag

Code Organization Anti-Patterns

  • Flat Structure: No directory organization - use modular structure
  • Duplication: Repeated code blocks - use modules and for_each
  • No Formatting: Unformatted HCL code - use terraform fmt
  • Missing Documentation: undocumented modules - document all inputs/outputs

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

26.48%
按下载量换算237

OpenCode

25.35%
按下载量换算227

windsurf

16.14%
按下载量换算144

Codex

13.22%
按下载量换算118

Cursor

7.87%
按下载量换算70

Gemini CLI

3.33%
按下载量换算30

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills