terraform init -upgrade

Category: IaC & Automation

terraform init -upgrade

Reinitialize and upgrade providers and modules to newest versions

Re-runs initialization while upgrading every provider and module to the latest version that still satisfies your version constraints. Terraform records chosen versions in the lock file (.terraform.lock.hcl), so this flag is how you deliberately move forward. Run plain terraform init first on a fresh clone to install plugins and configure the backend, the storage where state lives. Related: terraform providers.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.