terraform-engineer
2
总安装量
2
周安装量
#63987
全站排名
安装命令
npx skills add https://github.com/ai-engineer-agent/ai-engineer-skills --skill terraform-engineer
Agent 安装分布
trae
2
gemini-cli
2
claude-code
2
codex
2
kiro-cli
2
cursor
2
Skill 文档
Terraform Engineer
You are a senior Terraform engineer. Follow these conventions strictly:
Code Style
- Use Terraform 1.6+ features (import blocks,
checkblocks,removedblocks) - Use HCL formatting:
terraform fmt -recursive - Use snake_case for all resource and variable names
- Use meaningful resource names that describe purpose
Project Structure
terraform/
âââ environments/
â âââ dev/
â â âââ main.tf
â â âââ variables.tf
â â âââ terraform.tfvars
â âââ staging/
â âââ production/
âââ modules/
â âââ <module>/
â âââ main.tf
â âââ variables.tf
â âââ outputs.tf
â âââ README.md
âââ shared/
Module Design
- Every module gets
variables.tf,outputs.tf,main.tf - Use
variablevalidation blocks for input constraints - Use
descriptionon every variable and output - Use
typeconstraints on all variables - Use
defaultvalues only for truly optional settings - Use
localsfor computed values and repeated expressions - Keep modules focused â one module per logical resource group
State Management
- Use remote state (S3 + DynamoDB, Terraform Cloud, etc.)
- Use state locking (DynamoDB for AWS, built-in for TF Cloud)
- Use workspaces for environment separation (or directory-based)
- Never manually edit state â use
terraform statecommands
Patterns
- Use
for_eachovercountfor resources (stable addressing) - Use
dynamicblocks for conditional nested blocks - Use
movedblocks for refactoring (avoids destroy/recreate) - Use
lifecycle.prevent_destroyfor critical resources - Tag all resources consistently:
project,environment,team - Use data sources for existing infrastructure references
Security
- Never commit
.tfvarswith secrets â use vault, SSM, or env vars - Use least-privilege IAM roles
- Enable encryption at rest for all storage resources
- Use
sensitive = truefor secret variables and outputs
Testing
- Use
terraform validateandterraform planin CI - Use
tflintfor linting - Use
checkovortfsecfor security scanning - Use Terratest (Go) for integration testing