terraform
Deep Terraform risk knowledge covering provider-specific patterns, state operations, lifecycle rules, and common failure modes across AWS, GCP, and Azure.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Deep Terraform risk knowledge covering provider-specific patterns, state operations, lifecycle rules, and common failure modes across AWS, GCP, and Azure.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Deep Ansible operational knowledge covering dangerous module classification, idempotency violations, inventory targeting risks, privilege escalation patterns, and handler ordering pitfalls.
ArgoCD sync and application-set guidance for GitOps delivery changes across shared clusters.
AWS CDK guidance for logical IDs, removal policies, and synth-time environment drift.
Azure Bicep guidance for deployment modes, secret exposure, and subscription-target drift.
Cert-Manager issuance and renewal guidance for issuer, solver, and secret-rotation changes.
Deep CloudFormation risk intelligence covering resource replacement detection, deletion policies, drift patterns, stack dependencies, IAM resource risks, and service quota awareness.
| name | terraform |
| version | 1.0.0 |
| author | DeployWhisper |
| license | MIT |
| triggers | [".tf",".tfvars",".tfvars.json","terraform-plan.json","tfplan.json"] |
| token_budget | 1800 |
| tags | ["terraform","iac","infrastructure"] |
| description | Deep Terraform risk knowledge covering provider-specific patterns, state operations, lifecycle rules, and common failure modes across AWS, GCP, and Azure. |
| test_suite_path | tests/skill-tests/terraform |
0.0.0.0/0 or ::/0 on any port other than 80/443 = CRITICAL — database ports (3306, 5432, 6379, 27017) exposed to the internet are an immediate data breach riskAction: "*" or Resource: "*" = CRITICAL — grants god-mode access; every resource in the account is exposedblock_public_access enabled = CRITICAL — data exfiltration risk; default should always be block-allPrincipal: "*" = CRITICAL — public read/write to the bucketpublicly_accessible = true = CRITICAL — database directly reachable from the internetsts:AssumeRole trust policy allowing external accounts without conditions = CRITICAL — cross-account privilege escalationdeletion_protection = true = CRITICAL — a terraform destroy or accidental removal deletes the database permanentlyfinal_snapshot_identifier = HIGH — no backup taken before deletionpoint_in_time_recovery enabled = HIGH — no recovery from accidental data corruptiondelete_on_termination = true on production data volumes = HIGHsnapshot_retention_limit > 0 = MEDIUM — no recovery from cache corruption or accidental flushprevent_destroy = true — flag as CRITICAL if a destroy action appears for this resource; Terraform will error but CI pipelines may not surface this clearlyignore_changes on security-relevant attributes — warn that drift may exist between actual state and desired state; the ignored attributes could have been manually changed to something dangerouscreate_before_destroy = true — during replacement, both old and new resources exist simultaneously; watch for naming conflicts, IP address changes, and brief service duplicationreplace_triggered_by — replacement cascades to dependent resources; verify the full chain is understoodterraform state mv or terraform state rm commands in CI/CD = CRITICAL — manual state manipulation can orphan or duplicate resourcesterraform apply from multiple CI pipelines on the same state file causes lock failures and potential corruptionmoved blocks and refactoringaws_ami with most_recent = true) — the AMI ID can change between plan and apply, causing unexpected instance recreationtimestamp() or uuid() functions in resource attributes — forces replacement on every applyaws_instance.web to aws_instance.app destroys and recreates the instance)count vs for_each migration — switching from count to for_each on existing resources forces destruction and recreation of ALL instances because the state key format changes (numeric index vs string key)count index shift — removing an item from a list used with count causes all subsequent resources to shift indices, triggering cascading destroys and recreates (e.g., removing server[1] causes server[2] to become server[1], which Terraform interprets as a replacement)apply_immediately = true — triggers immediate reboot; without it, changes are deferred to the next maintenance windowmin_size/max_size/desired_capacity changes take effect gradually; setting desired to 0 kills all instances immediatelydeployment_minimum_healthy_percent is too low, rolling deployments may cause downtimegoogle_project_iam_binding removes all other bindings for the specified role; use google_project_iam_member for additive bindings| Resource type | Base risk weight | Rationale |
|---|---|---|
| Security group / firewall rule | 0.90 | Direct network exposure |
| IAM policy / role | 0.90 | Access control, blast radius if compromised |
| RDS / Cloud SQL / database | 0.95 | Data loss, downtime |
| S3 / GCS / storage bucket | 0.80 | Data exposure, lifecycle |
| VPC / network | 0.85 | Infrastructure connectivity |
| EC2 / VM / compute | 0.50 | Replaceable, stateless (usually) |
| Lambda / Cloud Function | 0.40 | Stateless, fast rollback |
| Load balancer | 0.70 | Traffic routing, potential downtime |
| DNS record | 0.75 | Propagation delay makes rollback slow |
| Tags / labels | 0.05 | Cosmetic, no operational impact |
| CloudWatch / monitoring | 0.15 | Observability, not runtime |
| SNS / SQS / messaging | 0.60 | Message loss potential |