基本上 terragrunt 的使用和 terraform 都一樣,所以才說 terragrunt 是一層 wrapper。
terragrunt init terragrunt plan terragrunt apply
和 terraform 都一樣對吧 !
![](https://aryido.github.io/images/terraform/terragrunt.jpg)
基本上 terragrunt 的使用和 terraform 都一樣,所以才說 terragrunt 是一層 wrapper。
terragrunt init terragrunt plan terragrunt apply
和 terraform 都一樣對吧 !
變數管理也是一個讓 code 更加 DRY 的方式之一, terragrunt 有蠻多傳遞變數的方式,這邊舉例 inputs
Provide 是整個 terraform 最重要的元件,是決定要對哪一個平台操作 (e.g. AWS, Azure, gcp),負責和雲端 API 的接口交互,可以在不了解 API 細節的情況下,通過 terraform 來編排資源。
Terraform Backend 可將 Terraform State 存儲在雲端位置,例如 S3 bucket, azure blob storage, gcp cloud storage,並提供 lock 以防止 race conditions 。 Terragrunt 還進一步讓流程更簡便…
Terragrunt 是 gruntwork 推出的一個 Terraform thin wrapper,在執行 Terraform 前可以先調整 root module 內的 .tf 檔案,保持程式碼的精簡,並提供許多額外的工具和框架幫助開發,藉此可以讓你的 IaC code 更貼近 DRY 原則。