Which `terraform init` flags matter and when do you use them?
IntermediateConceptWorkflow and CLI
Answer
-upgrade re-resolves provider and module versions; -reconfigure ignores previous backend config; -migrate-state copies state to a new backend; -backend-config=file_or_key=value supplies partial backend config such as bucket names; -input=false for CI; -lockfile=readonly to fail rather than modify the lock file.
More on Workflow and CLI
What does `terraform init` do?BeginnerWhat does `terraform plan` do?BeginnerWhat does `terraform apply` do and what is `-auto-approve`?BeginnerWhat does `terraform destroy` do?BeginnerWhat do `terraform fmt` and `terraform validate` check?BeginnerWhy save a plan with `-out` and apply that file?Intermediate