OpenTofu is an open-source infrastructure as code tool that uses HCL (HashiCorp Configuration Language) to declaratively manage cloud infrastructure. It is a community-driven fork of Terraform, fully compatible with existing Terraform providers and modules, with exclusive features like native state encryption. Pulumi provides an alternative IaC approach using general-purpose languages (TypeScript, Python, Go) inst...
When to use: Managing cloud infrastructure declaratively, provisioning multi-cloud resources, enforcing infrastructure consistency across environments, encrypting state at rest (OpenTofu), using familiar programming languages for IaC (Pulumi).
When NOT to use: One-off scripts better suited to CLI tools, application-level configuration management (use Ansible/Chef), container orchestration logic (use Kubernetes manifests), simple static hosting (use platform-native tools).
使用 OpenTofu(開源 Terraform 分支)和 Pulumi 的基礎架構即程式碼。涵蓋 OpenTofu HCL 語法、提供者、資源、資料來源、模組、具有遠端後端的狀態管理、工作區、匯入現有基礎設施、規劃/應用程式工作流程、變數管理、輸出值、設定程式和狀態加密(OpenTofu 獨有)。包括 Pulumi TypeScript/Python SDK、堆疊管理、元件資源、配置/秘密、狀態後端、策略即程式碼和自動化 API。多環境設定、模組組合、CI/CD 整合、偏差檢測和秘密管理的常見模式。 在編寫或檢查 HCL 配置、管理雲端基礎架構狀態、從 Terraform 遷移到 OpenTofu、使用 TypeScript 或 Python 建置 Pulumi 程式、設定多環境 IaC 管道或實施狀態加密時使用。 來源:oakoss/agent-skills。