terraform-infrastructure
使用 Claude 自動化 Terraform 基礎設施
管理複雜的 Terraform 基礎設施需要協調多個技能和工作流程。此技能套件將 Terraform 設定、資源配置、模組建立和狀態管理整合到結構化的工作流程中,可與您的 CI/CD 管道整合。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「terraform-infrastructure」。 Help me set up a new Terraform project for deploying AWS resources
預期結果:
I'll help you set up a Terraform project for AWS. First, let me initialize the Terraform configuration: [Creates main.tf with provider and backend blocks, then variables.tf for input parameters, and outputs.tf for exported values]
正在使用「terraform-infrastructure」。 Create a module for deploying a web application infrastructure
預期結果:
I'll create a reusable Terraform module for your web application: [Generates module structure with main.tf containing ALB, ASG, and security group resources, variables.tf with configurable parameters, and README with usage examples]
安全審計
安全Static analysis detected 31 potential security issues (27 external commands, 4 weak crypto). All findings are FALSE POSITIVES. The 'external commands' are markdown code references to other skills (e.g., `@terraform-skill`, `@terraform-specialist`) in documentation. The 'weak crypto' findings are documentation text mentioning cryptography, not actual implementation. This is a documentation-only workflow bundle with no executable code.
品質評分
你能建構什麼
雲端基礎設施設定
DevOps 工程師使用此工作流程從初始化到資源部署來建構 Terraform 專案。
Terraform 模組開發
平台團隊建立可重複使用的基礎設施元件,遵循此工作流程來建構具有適當介面的結構化模組。
多環境部署
管理生產、預發布和開發環境的基礎設施負責人使用此工作流程來建立一致的多環境模式。
試試這些提示
幫我設定一個用於部署 AWS 資源的新 Terraform 專案。配置 S3 後端用於狀態儲存,並設定 AWS 供應商。
我需要建立一個 Terraform 模組來部署具有負載平衡器、自動擴展群組和安全群組的 Web 應用程式。包含用於自定義的輸入變數。
為開發、預發布和生產環境設定 Terraform 工作區。每個環境應該有隔離的狀態和變數檔案。
建立一個 GitHub Actions 工作流程,在提取請求上執行 terraform plan,並在 main 分支上需要審批才能執行 terraform apply。
最佳實務
- 在執行 terraform apply 之前始終運行 terraform plan 以在部署前檢視變更
- 使用啟用鎖定的遠端狀態後端,以防止並發狀態修改
- 每個環境的狀態檔案分開,以維持適當的隔離並減少爆炸半徑
避免
- 避免將敏感值儲存在 Terraform 狀態中 - 使用環境變數或密鑰管理員
- 不要在 Terraform 之外手動修改雲端資源,因為這會造成配置漂移
- 永遠不要將 .tfstate 檔案提交到版本控制,因為它們可能包含敏感資料