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.
More on CI/CD and Automation
Why run Terraform from a pipeline instead of laptops?BeginnerWhat stages does a good Terraform pull-request pipeline have?BeginnerHow do you make sure the apply runs exactly what was reviewed?IntermediateHow do you serialize applies to the same stack in CI?AdvancedShow a minimal GitHub Actions workflow for plan on PR.BeginnerHow does OIDC authentication from GitHub Actions to AWS work?Intermediate