Terraform
Plugin
Cache
Posted on 2024-01-13

Introduction

最近在開發 Terraform Module 時,我經常需要使用 terraform init,因為我用的是 M1 晶片,所以每次裝 Terraform 都得額外裝不少插件,每回都要重新下載這些插件,真的是又麻煩又耗時。。

幸運的是,我在 Terraform 中發現了一種可以 cache plugin 的方法。這對於提高開發速度非常有幫助。

📝 我在這裡記錄下這個方法,希望它也能對其他人有所幫助。

Code

touch ~/.terraformrc
vi ~/.terraformrc
plugin_cache_dir   = "$HOME/.terraform.d/plugin-cache"
disable_checkpoint = true

Reference

Terraform

Made with ❤️ by Jiawei