Interview Prep/Terraform/Providers, Resources and Data Sources

How do you install providers in an air-gapped or rate-limited environment?

IntermediateConceptProviders, Resources and Data Sources
Answer

Use a filesystem mirror (terraform providers mirror ./mirror) or a network mirror configured in ~/.terraformrc under provider_installation, and set plugin_cache_dir to avoid re-downloading in CI.

provider_installation {
  filesystem_mirror { path = "/opt/terraform/mirror"  include = ["hashicorp/*"] }
  direct { exclude = ["hashicorp/*"] }
}
All Terraform questions Roadmap: Terraform

More on Providers, Resources and Data Sources