terraform-plan
Review Terraform plans and configurations for safety and best practices. Use when the user says "review terraform", "terraform plan", "what will this destroy", "check my infrastructure code", or asks about Terraform changes.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Terraform Plan Review
Analyze Terraform plans and configurations to prevent destructive changes and ensure best practices.
Instructions
- Read relevant
.tffiles to understand the configuration - Run
terraform planif not already provided - Identify destructive operations (destroy, replace)
- Check for security and best practice issues
- Summarize changes with risk assessment
Plan analysis
# Generate plan
terraform plan -out=tfplan
# Show plan in detail
terraform show tfplan
# JSON output for parsing
terraform show -json tfplan
Critical alerts - MUST flag
- Any
destroyoperations on stateful resources (databases, storage) - Any
replaceoperations (forces new resource) - Changes to
prevent_destroylifecycle settings - Modifications to IAM policies or security groups
- Changes to encryption settings
- Removal of backup configurations
Security checks
- No hardcoded secrets in
.tffiles - Sensitive variables marked as
sensitive = true - S3 buckets have encryption and versioning
- Security groups not open to 0.0.0.0/0
- RDS/databases not publicly accessible
- KMS keys have rotation enabled
Best practices
- Remote state with locking (S3+DynamoDB, Terraform Cloud)
- State encryption enabled
- Provider versions pinned
- Module versions pinned
- Variables have descriptions and validation
- Resources properly tagged
Output format
## Destructive Changes (REVIEW CAREFULLY)
- aws_db_instance.main will be DESTROYED
## Modifications
- aws_security_group.web: ingress rules changing
## Additions
- aws_instance.new_server
## Risk Assessment: HIGH/MEDIUM/LOW
Rules
- MUST highlight all destroy/replace operations prominently
- MUST warn about stateful resource changes
- Never run
terraform applywithout explicit user approval - Never run
terraform destroy - Always recommend
terraform planbefore apply
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!