Interview Prep/Terraform/CI/CD and Automation

How do you speed up `terraform init` in CI?

BeginnerProductionCI/CD and Automation
Answer

Set TF_PLUGIN_CACHE_DIR and cache that directory between runs keyed on the lock file hash, or use a provider mirror close to the runners. Avoid re-downloading the 500 MB AWS provider per stack in a matrix job. Make sure the cache is keyed per platform.

All Terraform questions Roadmap: Terraform in production

More on CI/CD and Automation